Skip to content

Instantly share code, notes, and snippets.

Created December 24, 2012 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/4370909 to your computer and use it in GitHub Desktop.
Save anonymous/4370909 to your computer and use it in GitHub Desktop.
<?php
require_once("recaptchalib.php");
$privatekey = ""; //<!----- your key here
$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. Please go back and try it again. <a href=\"javascript:history.go(-1)\">Back</a>"
//"(reCAPTCHA said: " . $resp->error . ")
echo "fail";
} else {
echo "success";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment