Skip to content

Instantly share code, notes, and snippets.

@madan712
Created February 17, 2013 18:23
Show Gist options
  • Save madan712/4972646 to your computer and use it in GitHub Desktop.
Save madan712/4972646 to your computer and use it in GitHub Desktop.
PHP example - Google Recaptcha validation using jquery (AJAX)
<?php
require_once('recaptcha-php-1.11/recaptchalib.php');
$privatekey = "your_private_key";
$resp = recaptcha_check_answer ($privatekey,$_POST["remoteip"],$_POST["challenge"],$_POST["response"]);
if (!$resp->is_valid) {
echo "false";
}
else {
echo "true";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment