开发者

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"]);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜