Defining CAPTCHA
A CAPTCHA (Completely Automated Turing Test To Tell Computers and Humans Apart) is an application that tries to tell the difference between a human and a computer. These applications are widely used to help prevent spam because it will prevent junk e-mail programs called spam bots to send messages or fill out forms. However, it will allow human users to proceed in sending the e-mail or fill out the form.
A CAPTCHA presents the user with a couple different words or character strings that the user then has to then retype into a text field. If the user is human, this request does not pose a problem. On the other hand, if the user is a spambot, then it will not be able to "read" the CAPTCHA and will be stopped in its tracks.
Defining reCAPTCHA
reCAPTCHA is a CAPTCHA program that does not display random words or character strings but instead presents words that assist in the digitizing of physical books. reCAPTCHA also conforms to Section 508 in the United States by providing an audio version of reCAPTCHA for visually-impaired individuals.
Setting Up and Using reCAPTCHA
You can implement reCAPTCHA on your site by following the instructions below:
- Visit Google's reCAPTCHA site
- Sign-up for a reCAPTCHA account (it's free)
- Enter the domain name you wish to use
- Write down your public and private key
- Log into your Web hosting account via SSH
- Run the following command in the directory where your website's files reside
cp /usr/www/cgi-bin/recaptcha_formmail.pl .
- Open the file up and replace "your_private_key_goes_here" with your private key. Make sure you don't go below the line that says "DO NOT EDIT BELOW THIS LINE."
- Set up your formmail form as described in our formmail article with the following two changes:
- Call your edited version of recaptcha_formmail.pl instead of /cgi-bin/formmail.pl (in the <FORM> action)
- Paste the following code into the closing </head> tag of the HTML page that contains your form:
<script src='https://www.google.com/recaptcha/api.js '></script>
- Then, paste the following code at the end of the <form> where you want the reCAPTCHA widget to appear:
<div class="g-recaptcha" data-sitekey="your_site_key"></div>
- Replace your_site_key with your actual site key
If you're concerned about using Javascript version of the widget, you can set up a reCAPTCHA widget without Javascript. Check out how to do this by going to the reCAPTCHA FAQ page and following their instructions.
More information on implementing reCAPTCHA on your site can be found on reCAPTCHA's resources page.
The Perl, PHP, Ruby, and Python interfaces to reCAPTCHA mentioned on this resource page are installed on all Pair Networks servers for your use.