Answer the question
In order to leave comments, you need to log in
Why does the missing-input-response google recaptcha 2 error occur?
Others why an error occurs when installing captcha I
use the Bitrix management system
What I do
1. In php init I connect secret keys and captcha files
@require_once 'include/autoload.php';
define("RE_SITE_KEY","6LcM1BATAAAAAL8WJjzVauo8oR1c8df334CbJWw7Me8uC");
define("RE_SEC_KEY","6LcM1BATAAAAAAk3_djGibj67kf5342fdfAHMGPYJuxl1yk");
<script src='https://www.google.com/recaptcha/api.js?hl=ru'></script>
<div class="g-recaptcha" data-sitekey="<?=RE_SITE_KEY?>"></div>
$recaptcha = new \ReCaptcha\ReCaptcha(RE_SEC_KEY);
$resp = $recaptcha->verify($_REQUEST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()){
foreach ($resp->getErrorCodes() as $code) {
echo "Ошибка! Проверка не пройдена.";
echo $code;
return;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question