简体   繁体   中英

Google Captcha in registration form verify.php issue

I used google captcha in my site registration form as google example:

  <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>


in the verify.php this code

<?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
}
?>

everything works fine, the captcha finds out the correct/wrong captcha combination but when i click the submit button it shows a blank page with URL htt://mysite/folder/very.php It should continue to the email verification but it doesn't..

Could you please show us your code? Actually, if it goes in the right statement (if || else) , the problem is in the part of the code which you don't post.

Seems like an error has occurred in your mail sending method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM