Captcha BY IT4CRAIGSLIST - Google Integration

Captcha

Get Started

Sign up with Google to get an account, API public key and private key
https://developers.google.com/recaptcha/docs/start

Client Interface - Theme

Client Interface - HTML codes

HTML form looks like this:

<form method="post" action="verify.php"> require_once('recaptchalib.php'); $publickey = "your_public_key"; // you got this from the signup page echo recaptcha_get_html($publickey); <br/> <input type="submit" /> </form>

Server-side/Back-end codes to check answer

PHP back-end codes

require_once('recaptchalib.php'); $privatekey = "your_private_key"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } else { // Your code here to handle a successful verification }