Do I need captcha public key and/or private key for localhost?
I am developing locall开发者_StackOverflow中文版y with PHP on Xampp.
I am trying to use recaptcha.
Do I need public and/or private key?
Thanks in advance.
In order to use reCAPTCHA, you need a public/private API key pair.
Using the PHP Library, to display the CAPTCHA:
require_once('recaptchalib.php');
$publickey = "..."; // you got this from the signup page
echo recaptcha_get_html($publickey);
and then to verify:
require_once('recaptchalib.php');
$privatekey = "...";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
精彩评论