验证码表单集成不工作


ReCaptcha form integrade not working

我想为我的表单创建一个验证码。

我已经通过了文档,但是我如何将验证码转换为表单…我使用了私钥,但那不起作用…

http://www.the-big-bbq.co.uk/invitation.php prettyPhoto

这是网站

现在正在显示,但是如果我不输入任何东西,表单仍然会提交。

代码:

 <?php
require_once('recaptchalib.php');
// Get a key from https://www.google.com/recaptcha/admin/create
$publickey = "i have added the key here";
$privatekey = "i have added the key here";
# the response from reCAPTCHA
$resp = null;
# the error code from reCAPTCHA, if any
$error = null;
# was there a reCAPTCHA response?
if ($_POST["recaptcha_response_field"]) {
$resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);
if ($resp->is_valid) {
        echo "You got it!";
} else {
        # set the error code so that we can display it
        $error = $resp->error;
}
}
 echo recaptcha_get_html($publickey, $error);
?>

我也遇到了同样的问题。因此,我在页面上添加了Java函数validateForm()。现在,在所有必要的字段都有正确的输入之前,它不会进入重审步骤。

我在我的html表单页面中使用了以下代码来显示recaptcha字段:

<!-- Google recaptcha -->
    <tr>
    <td colspan="5">
    <script type="text/javascript"
   src="http://www.google.com/recaptcha/api/challenge?k=0000000000000000000000...">
</script>
<noscript>
   <iframe src="http://www.google.com/recaptcha/api/noscript?k=0000000000000000000000..."
       height="65" width="109" frameborder="0"></iframe><br>
   <textarea name="recaptcha_challenge_field" rows="2" cols="2">
   </textarea>
   <input type="hidden" name="recaptcha_response_field"
       value="manual_challenge">
</noscript>
    </td>
    <tr>

我有它到我的网站。但是服务器验证:"验证用户的答案没有插件"。不会工作。我尝试添加verify.php操作(并将必要的.php文件添加到我的根目录中)。但没有什么。

    <form name="reserveringen" method="post" onsubmit="return validateForm();" action="verify.php">
<?php
require_once('recaptchalib.php');
          $publickey = "0000000000000000000000..."; 
          echo recaptcha_get_html($publickey);
?>