»  Home  »  Programming  »  Getting started with CAPTCHA
Getting started with CAPTCHA
By Rodney Amato | Published 07/19/2006 | Programming | Rating: ratingfullratingfullratingfullratingfullratingempty Unrated |
Conclusion

Conclusion

After you're happy with your CAPTCHA strength, you need to setup the check in your form submission page to check that the person filling out the form has entered the correct code. This is very easy to do and all it takes is a simple if statement:

if ($_SESSION['captcha'] != $_POST['captcha']) {
echo "The image verification failed.<br />\n";
return false;
}
...which could easily drop into the function that checks that they filled the form in properly.

You should keep in mind however that if you make your CAPTCHA very strong then sometimes a person might not be able to work out what the text says and may accidently type a letter wrong so if the form is one that they may take a while to fill out like a contact form, you should redisplay their form with the warning rather then taking them to the results page and then going back to a form that they will have to fill out all over again.

A CAPTCHA can be a very effective way to reduce the amount of spam submitted to your site, however you should also be aware of the limitations of a CAPTCHA when choosing if you should implement one on your site.


Pages: « Back  1 2 3 4 5 6 7  Next » 

6 Responses to "Getting started with CAPTCHA"


 
Pau Rating: ratingfullratingfullratingfullratingfullratingfull Unrated
said this on 13 Sep 2006 4:41:22 PM CDT
Excellent Article !

Thks

 
Douglas Rating: ratingfullratingfullratingfullratingfullratingfull Unrated
said this on 26 Sep 2006 5:19:56 PM CDT
Nice article indeed,
Thanks Rodney... ;)

 
Douglas Rating: ratingfullratingfullratingfullratingemptyratingempty Unrated
said this on 26 Sep 2006 5:37:17 PM CDT
In the function CreateCaptchaImage
if (!is_file(dirname(__FILE__).'/captcha.ttf') {
Needs to be
if (!is_file(dirname(__FILE__).'/captcha.ttf')) {

Thanks again Rodney

 
Alfred Robert Rowe Rating: ratingfullratingfullratingfullratingfullratingfull Unrated
said this on 01 Nov 2006 7:14:12 AM CDT
excellent article. You are a conerstone.
just as a reminder anybody trying to include the randome font function must comment or delete this lines
if (!is_file(dirname(__FILE__).'/captcha.ttf')) {
return false;
}
you codes will still work though if you keep the font captcha.ttf and still maintain the fonts folder. but as soon as you delete captcha.ttf from that location your code will fail.

 
ankit Rating: ratingfullratingfullratingfullratingemptyratingempty Unrated
said this on 07 Feb 2007 3:27:13 AM CDT
i have to deliver a seminar on captcha , i have found this very useful and worthwile

 
Captcha Rating: ratingfullratingfullratingfullratingfullratingempty Unrated
said this on 10 Jan 2008 4:05:50 AM CDT
Hi .. good article .. I noticed another method... the image of an animal and the captcha question said - "Verification
Please enter the word describing the type of animal shown below. "



Rate this article and leave a reply:
1 2 3 4 5
Poor Excellent
Your Name *: Email (private) *: Website:
Please copy the characters from the image below into the text field below. Doing this helps us prevent automated submissions.
Security Code: img

Web designers: Learn how to attract more clients and profit like the big guys. Subscribe to our newsletter.