开发者

Do I need captcha public key and/or private key for localhost?

开发者 https://www.devze.com 2022-12-18 11:24 出处:网络
I am developing locall开发者_StackOverflow中文版y with PHP on Xampp. I am trying to use recaptcha.

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

精彩评论

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