reCaptcha始终在iPage主机上返回false

时间:2016-08-04 02:20:21

标签: php recaptcha

我有一个不适用于特定网站的recaptcha,我无法理解为什么。在我的主机上它工作正常,但是当我在iPage主机上测试时,它总是返回false,即使是一个简单的测试表单,它总是错误的。

我尝试过重做钥匙。我甚至可以在下面看到基本的表格,但总是返回false。没有错误。

http://legionoffoam.com/new/form.html

form.html

<html>
<head>
    <script src='https://www.google.com/recaptcha/api.js'></script>
</head>
<body>
    <form action="test-recaptcha.php" method="post">
        <div class="g-recaptcha" data-sitekey="6LdXvCYTAAAAAOzMaqHb6lFZrIVnATbo7PxzvSfS"></div>
        <input type="submit" value="SUBMIT" id="submit">
    </form>
</body>
</html>

测试recaptcha.php

<?php

require_once "recaptchalib.php";

$secret = "<<SECRET>>";

$response = null;
$reCaptcha = new ReCaptcha($secret);

if ($_POST['g-recaptcha-response']) {
    $response = $reCaptcha->verifyResponse(
        $_SERVER["REMOTE_ADDR"],
        $_POST['g-recaptcha-response']
    );
}

var_dump($response);
var_dump($_POST);

的回复:

{["success"]=> bool(false) ["errorCodes"]=> NULL }

0 个答案:

没有答案
相关问题