Google Captcha在注册表中验证了.php问题

时间:2014-09-30 09:09:20

标签: php forms registration captcha

我在网站注册表单中使用谷歌验证码作为谷歌示例:                  

  <form method="post" action="htt://mysite/folder/verify.php">
    <?php
      require_once('htt://mysite/folder/recaptchalib.php');
      $publickey = "your_public_key"; // you got this from the signup page
      echo recaptcha_get_html($publickey);
    ?>
    <input type="submit" />
  </form>

  <!-- more of your HTML content -->
</body>


在verify.php中这段代码

<?php
require_once('htt://mysite/folder/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
}
?>

一切正常,验证码找出正确/错误的验证码组合,但当我点击提交按钮时,它会显示一个带有URL的空白页面:htt://mysite/folder/very.php 它应继续进行电子邮件验证,但它不会......

1 个答案:

答案 0 :(得分:0)

你能告诉我们你的代码吗?实际上,如果它出现在正确的语句(if || else)中,则问题出在您未发布的代码部分。

似乎在您的邮件发送方法中发生了错误。