I'd like to code a captcha script. At first, I thought life would be easy. All I need to do is create several images that display the captcha code, store these on the server and in a database. Then simply randomly select one from the database where I'd store the image path and the code within the image and everything else would be straight forward. I now understand that hacking this method is really easy. All that one needs to do is find the directory on the server where the images are stored, open the files, look at them and associate the name of the file with the visible code. So my idea about captchas doesn't seem that clever anymore. A better way would be to generate the captchas on the fly, without storing them in a db table or in a directory. The problem is I don't know how to create these captchas. Does anyone know how one can manipulate an image in PHP?
You should search captcha tutorials on google, there are many methods of creating images, you should read as much as you can and use what parts you like from each site ..... There are sooo many ways it would be silly to post one.
there is a link to a very good captcha ready made: http://www.eire-webdesign.ie/t-Fighting-Spam---Protect-your-forms-g4-next1.html
search the open source sites and you will get lots of methods for captcha. blend them together and make a good one