php5

How to avoid black background when rotating an image 45 degree using PHP?

Hi I have to flip a thumpnail image before merge it with another jpeg file. but when I rotate 45 degree using php. It shows a black background. how can I avoid that. any body can help me. ...

How to rotate image completely. with out showing the black portion.

I have an image I have to rotate that image 25 degree. if I rotate it shows some black background. How can I avoid that. How can I rotate image completely with out showing the black portion by using PHP GD. I cant use js for rotation. because I have to merge the image with another one after rotation. any body have the scripts for this pl...

Catch a PHP Object Instantiation Error

It's really irking me that PHP considers the failure to instantiate an object a Fatal Error (which can't be caught) for the application as a whole. I have set of classes that aren't strictly necessary for my application to function--they're really a convenience. I have a factory object that attempts to instantiate the class variant that'...

How to install ImageMagick in windows?

Hi I just install image magick as per the php.net description. but its doesnt working well. it always shows this error Fatal error: Class 'Imagick' not found in C:\wamp\www\shobtest\imgborder.php on line XXX why this error happening. I restarted my webserver. but it still showing this error. ...

Create associative multi-dimensional array

Hi, I have 3 variables, each one holding a different information and send values from a text file dynamicaly. I want to put them in a Associative multi-dimensional array. let's say : $product sends car, truck, train, etc. $price sends 1000, 3000, 1500, etc. $year sends 1997, 1980, 2008, etc. How to create a function which generate...

Difference between executing php from the commandline and from the Http Side

What is the difference between executing php from command line and from Http side .Do They use the same executable such as (Php.exe or php-cgi.exe ( Apache or IIS )).Do the Results differ when they are executing from Commandline or HTTP side. ...

Framework or CMS for php web development?

Hi all, I am a C++,Unix developer who has never dabbled in web development apart from creating simple HTML pages. I am going to change that and develop a website at a personal level soon. I am going to use php,mysql on a linux machine. In this regard I am browsing through relevant literature. The language isn't a problem but reading abo...

Difference between Class Abstraction and Object Interfaces in PHP?

What is the difference between a Class Abstraction and an Object Interfaces in PHP? I ask because, I don't really see the point to both of them, they both do the same thing! So, what are the advantages of disadvantages using both against one or the other? Class Abstraction: abstract class aClass { // Force extending class to define...

PHP Session Management, Counting Users With Cookie

I want to, upon loading the page, store a cookie in the user's browser. Then, using AJAX, count the number of users with that cookie and send it off to a database row every 1 second or so. How is this accomplished? ...

generating images with php based on css3 gradient settings?

Hi, Does anyone know if there is a php library, or if there isnt, have any input on how one would go about generating an image via php, from basic HTML element input settings, and CSS 3 gradient parameters. To give an example on why this would be useful, I have found as of a couple days ago, that laying out the wireframe for a webpage ...

Php is stripping one letter "g" from my rtrim function but not other chars

I'm trying to trim some youtube URLs that I am reading in from a playlist. The first 3 work fine and all their URLs either end in caps or numbers but this one that ends in a lower case g is getting trimmed one character shorter than the rest. for ($z=0; $z <= 3; $z++) { $ythref2 = rtrim($tubeArray["feed"]["entry"][$z]["link"...

How to get x y coordinates of an image in php

How to get x y coordinates of an image in php? I have an image $image = images/abc.png; how to get the coordinates of the image using php. ...

Getting php tips and tutorials as daily emails to improve the knowledge in php programming

Hi Thanks for your time. This question is related to php programming but not a programming question.I have a young team of php (LAMP + javascript) programmers.I want them to learn better coding and keep themselves updated with the latest advancements in web domain. I was thinking if there was any web site which send daily emails abou...

How to create thumbnail images with white 3px border using PHP?

How to create thumbnail images with white 3px border using PHP? any body have the scripts please help me :( ...

is there such a thing as xsl:fo reporting or xsl:fo simulation?

Hi, I am trying to determine if MY xsl:fo generated PDF file will exceed one page or not, without actually generating the output. We use Apache-FOP 0.95 on our server, and the XML data is being generated using a PHP DOMDocument class before being passed onto an XSL-FO template. My question: Are there PHP libraries out there that can s...

Regex match all newline characters within <p> in PHP

I have the following sample set of data: <p>first line\n second line\n third line\n</p> first line\n second line\n third line\n Using regex, how could I match on the newline characters, but only when they are within the paragraph tags. This code would be used within php. ...

Declaring variable as PHP class

I have a variable called $theclass and it's a string "Home_class". How can I define a class out of that string? The reason I need to do this is that the variable will change and I want to be able to declare the class that the variable is equal to. Is this possible? Thanks for any help. ...

PHP specifying a fixed include source for scripts in different directories

I am currently doing unit testing, and use folders to organize my test cases. All cases pertaining to managing of user accounts, for example, go under \tests\accounts. Over time, there are more test cases, and I begin to seperate the cases by types, such as \tests\accounts\create, \tests\account\update and etc. However, one annoying pro...

What is the efficient way to make a permission system?

Currently im just using something like: in the DB Table: access: home,register,login and then in each page: if(!Functions::has_rights('content')) { Functions::noAccess(); } is there more efficient way to do it, php & MySQL? i may want to gain access even to several parts a page, for example: user can read a page, but doesnt ...

php and mysql site design question

I am trying to build a website with mysql and php. This is the first site I have attempted so I want to write a little plan and get some feedback. The site allows users to add some text in a text field as a “comment”. Once the comment has been entered into the site it is added to the database where it can be voted for by other users. W...