captcha bar1 captcha help captcha bar1

ReCaptcha_php

Home
About Us
reCaptcha
Download
FAQ's
Demo
Blog
Contact Us
Email Protection
Challenge Response Test Captcha Image
 
PHP Library for reCAPTCHA
 

The reCAPTCHA PHP Library provides a simple way to place a CAPTCHA on your PHP website, helping you stop bots from abusing your website. The library wraps the reCAPTCHA API.

The library also includes an API for Mailhide, a way to wrap email addresses in a reCAPTCHA, hiding them from spammers.

reCAPTCHA Quickstart

These instructions should get you started quickly.

1.Download the reCAPTCHA Library, extract recaptchalib.php in the directory where you your forms live.
2.If you haven't done so, sign up for an API key.
3.Now we're ready to start modifying your code. First, we'll add code to display the CAPTCHA:

5)require_once('recaptchalib.php');
$publickey = "..."; // you got this from the signup page
echo recaptcha_get_html($publickey);

In the code that processes the form submission, you need to add code to validate the CAPTCHA. Otherwise, the CAPTCHA will appear, but the answers won't be checked. The validation code looks like:
require_once('recaptchalib.php');
$privatekey = "...";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
}