Creating images on the fly can be a very useful skill. PHP has some built-in image generation functions, further more, to generate new images or edit existing images on the fly using PHP, we need to have the GD library installed. Creating security images on the fly At first, have a look at the following script that creates captcha image. Next, we will consider each step of image generation in details. function create_image() //Set the image width and height //Create the image resource //We are making three colors, white, black and gray //Make the background black //Add randomly generated string in white to the image //Throw in some lines to make it a little bit harder for any bots to break //Tell the browser what kind of file is come in //Output the newly created image in jpeg format //Free up resources |
1
Votes
Votes
Dynamic Image Generation using PHP
Posted By tamilsolai on Mar 28, 2010 FROM: advancedphptutorial.blogspot.com report abuse




Post new comment