This article explains what CAPTCHA protection is, when you can use it, and some implementations in different programming languages that you can add to your website.
What is A CAPTCHA?
A CAPTCHA (Completely Automated Turing Test for Computers and Humans Apart) is a test that tries to determine whether a user is a human or a computer. The most common type of CAPTCHA is an image that shows blurred letters or numbers in a box. Users must type the correct order of letters or numbers to access site content or send data. Since these images are usually not readable by automated bots, the misuse of website resources is prevented.
When to Use CAPTCHA Protection?
You should add CAPTCHA protection to your site if your site has any of the following:
- Forms that handle user-submitted data, including comment forms, registration forms and email forms
- Poll or Surveys
- A page that allows users to upload or download files.
- Any other page that accepts user-submitted data.
CAPTCHA Implementation
Depending on the programming language your website uses, there are several free and open source CAPTCHA implementations.
PHP
Here are some of the many CAPTCHA implementations available for PHP:
- The Securimage script allows you to easily add PHP-based captchas to your website. Visit http://www.phpcaptcha.org for more information.
- The captchas.net service allows CAPTCHA implementations for various languages, including PHP. For more information, visit http://captchas.net/sample/php.
- Google offers a reCAPTCHA service. For general information about reCAPTCHA, please visit http://www.google.com/recaptcha. For specific information on implementing reCAPTCHA with PHP, visit https://developers.google.com/recaptcha/intro.
- If you are a programmer and want to write your own captcha implementation, you can use the Text_CAPTCHA PEAR package in PHP. For more information, see http://pear.php.net/package/Text_CAPTCHA.
Python
- The captchas.net service for PHP mentioned above also has a Python implementation. To know more, please visit http://captchas.net/sample/python.