我最近设置了reCaptcha,一切都很好,但是当我输入正确的captcha时,我得到的是一个白屏-我知道为什么这是因为我应该告诉reCaptcha去哪里。
我只是不太懂PHP,不知道该放什么,谁能帮我一下,PHP代码是:
<?php
require_once('recaptchalib.php');
$privatekey = "YOUR_PRIVATE_KEY";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
// What happens when the CAPTCHA was entered incorrectly
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
// Your code here to handle a successful verification
}
?>
您需要将发生的事情放在else
语句中。
} else {
// Your code here to handle a successful verification
}