在没有插件的情况下验证用户的答案reCAPTCHA

所以我试图用我的表格重新开始工作。这是我对表单的代码。
<form action="" method="post">
 <input type="text" name="text4" id="text4" style="width:400px" /><br/><br/>' . '<script type="text/javascript"
   src="http://www.google.com/recaptcha/api/challenge?k=XXXXXXXXXXXXXXXXXX">
</script>
<noscript>
   <iframe src="http://www.google.com/recaptcha/api/noscript?k=XXXXXXXXXXXXXXXXXX"
       height="300" width="500" frameborder="0"></iframe><br>
   <textarea name="recaptcha_challenge_field" rows="3" cols="40">
   </textarea>
   <input type="hidden" name="recaptcha_response_field"
       value="manual_challenge">
</noscript><input type="button" value="Submit"/>
我正在尝试使用没有插件的recaptcha。很容易让它显示,但我很难验证输入。任何人都知道如何在没有插件的情况下进行验证? 非常感谢。     
已邀请:
您的服务器端代码,以使reCaptcha工作,应该类似于这里发布的内容: http://wiki.recaptcha.net/index.php/Overview#Server_Side_.28How_to_test_if_the_user_entered_the_right_answer.29 在任何服务器端语言中,如果不使用类似于此的解决方案,就无法使reCaptcha工作。这是代码:
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
}
    

要回复问题请先登录注册