Last active
December 11, 2015 00:39
-
-
Save kurnias/4518345 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// call the lib.. | |
require_once('recaptchalib.php'); | |
// Get a key from http://recaptcha.net/api/getkey | |
$publickey = ""; | |
$privatekey = ""; | |
# was there a reCAPTCHA response? | |
if ($_POST["submit"]) { | |
$response = recaptcha_check_answer($privatekey, | |
$_SERVER["REMOTE_ADDR"], | |
$_POST["recaptcha_challenge_field"], | |
$_POST["recaptcha_response_field"]); | |
if ($response->is_valid) { | |
# Valid reCAPTCHA response here | |
echo "Yes, that was correct!"; | |
} | |
else { | |
# set the error code so that we can display it | |
echo "Eh, That wasn't right. Try Again."; | |
} | |
} | |
?> | |
<form action="verify.php" method="post"> | |
<?php echo recaptcha_get_html($publickey, $error); ?> | |
<input type="submit" value="submit" name="submit"/> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment