2017-07-06 41 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