我正在尝试制作一个显示错误 reCAPTCHA 输入错误的自动提示框,目前我有一个函数'redirect_to',它链接到一个相同的页面,我打算只以文本形式输入一个错误。如果有人可以帮助我,我将不胜感激,我对javascript没有太多经验。
require_once($_SERVER['DOCUMENT_ROOT'] . '/recaptcha/recaptchalib.php');
$privatekey ="*********";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER['REMOTE_ADDR'],
$_POST['recaptcha_challenge_field'],
$_POST['recaptcha_response_field']);
$str_result = "";
if (!$resp->is_valid) {
redirect_to("login_recap.php");
// What happens when the CAPTCHA was entered incorrectly
$message = "The reCAPTCHA wasn't entered correctly. Go back and try it again. (reCAPTCHA said: " . $resp->error . ")";
echo $message;
exit();
}