2014-09-24 126 views
0

我使用谷歌recaptcha,我的表单太简单了,它会显示google recaptcha,但它没有显示,没有错误出现,我不明白是什么问题,这里是我的代码:为什么谷歌recaptcha没有显示出来?

<html> 

    <body> 

     <form method="post" action="contact.php"> 
      <?php require_once('recaptchalib.php'); 
        $publickey = "6Ld72voSAAAAADku3vUoC712Zo8jUmjHJS8N77Ym"; // you got this from the signup page 
        echo recaptcha_get_html($publickey); 
      ?> 
     </form> 

    </body> 

</html> 
+0

@AdamSinclair reCAPTCHA的LIB是存在的,而且我相信,我使用的是正确的公钥 – 2014-09-24 13:27:05

+0

您是否已经验证你能够看到错误消息如果它们发生? (最简单的方法是自己生成一个,比如'echo $ does_no_exist;'。) – 2014-09-24 13:31:35

+0

您可能想要添加这个来调试'error_reporting(-1); ini_set('display_errors','On');' – 2014-09-24 13:32:57

回答

0

我知道这是一个老问题。但是,如果它可以帮助某人回答。

如果您的验证码正在使用其他服务器,请尝试将其更改为以下内容。

define("RECAPTCHA_API_SERVER", "http://www.google.com/recaptcha/api"); 
define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api"); 
define("RECAPTCHA_VERIFY_SERVER", "www.google.com"); 

它解决了验证码显示问题对我来说:)