2017-07-06 42 views
-1

我通过这个包在我的symfony 3项目的注册页面添加了google的reCAPTCHA:github/EWZRecaptchaBundle。 submiting注册表单后,我有这样的:symfony 3上的reCAPTCHA超时或重复返回

$api_url = "https://www.google.com/recaptcha/api/siteverify?"; 

$secret_key = "----my-key----"; 

$api_key = "&secret=" . $secret_key; 

$g_recaptcha_response = $_POST['g-recaptcha-response']; 

$api_response = "&response=" . $g_recaptcha_response; 

$api_remote_ip = "&remoteip=" . $_SERVER['REMOTE_ADDR']; 

$url = $api_url . $api_key . $api_response . $api_remote_ip; 

$response = json_decode(file_get_contents($url), true); 

的responde连锁行业我:

array(4) { ["success"]=> bool(false) ["challenge_ts"]=> string(20) "2017-07-06T16:49:56Z" ["hostname"]=> string(14) "********.com" ["error-codes"]=> array(1) { [0]=> string(20) "timeout-or-duplicate" } } 

超时或-重复没有他们的指导中记录。我不知道如何解决这个问题或从哪里来。

+0

你也可以检查: https://stackoverflow.com/questions/43678256/google-recaptcha-response-success-false-no-error-codes/45659347#45659347 –

回答

1

此包是否已经为您执行此操作(检查验证码并将表单设置为有效或无效),因此,您的自定义调用,重复或超时...(因为它已由捆绑软件完成bindRequest(我认为))

+0

是的,该包为我做 – symfonypleb