Recaptcha允许垃圾邮件

时间:2018-04-08 17:29:54

标签: php recaptcha spam

我为有联系表单的人创建了一个网站,但是他们说他们收到了很多垃圾邮件。

我添加了recaptcha V2,但它仍然被垃圾邮件发送。

    // other conditions to see if all fields were filled in come before this
} elseif($_POST["g-recaptcha-response"]=="") {
        $message="Please verify that you are human.";
} else {
    $data = array(
        'secret' => $secret,
        'response' => $_POST["g-recaptcha-response"],
    );
    $context = stream_context_create(array(
        'http' => array(
            'method' => 'POST',
            'content' => http_build_query($data),
        ),
    ));

    $verification = file_get_contents('https://www.google.com/recaptcha/api/siteverify', false, $context);
    $verification = json_decode($verification);
    $verified = $verification->success;

    if (!$verified) {
        $message="Error. You don't seem to be human! If this seems like a mistake, you can give us a ring at {$phone}.";
    } else {
        // sanitize input & send email
    }

客户端集成应该不是问题,因为我只是复制/粘贴了谷歌提供的内容._。

此外,当我访问recaptcha网站时,谷歌告诉我:

  

我们检测到您的网站正在验证reCAPTCHA通过的解决方案   不到50%的时间。这可能表明您的问题   与reCAPTCHA集成。请访问我们的开发者网站了解更多信   信息。

关于出了什么问题的任何想法?

0 个答案:

没有答案