Adding Captcha To Your Form

0 Comments | This entry was posted on Jun 25 2009

It wasn’t until this week that I required a form to be protected from spam. Captcha was the obvious choice but I did not know what was involved to add it to an existing site/form. For anyone who is thinking of doing the same I can assure you it is very quick and easy to do.

You can download the code and follow the quick start guide for PHP at

After downloading the files, move them into the sites path. You then just need to add some some short code segments into you existing form to include the captcha image and input field. Some code also needs to be added to the back-end including adding session_start() (If you’re not already using sessions) to validate the input once the form is submitted.

One dependency is that GD2 is installed which I believed is with most php5 installs these days on Linux anyway.

This shouldn’t take longer than 20 minutes. Had I known it was so easy I would have used it in previous jobs.