recaptcha
recaptcha copied to clipboard
Why would my V2 validation fail?
I have had reCAPTCHA V2 on my contact form for 1 year without a problem. Now since 5-7 days it has stopped working and i don't now why, all responses fail all of a sudden. I have done 0 changes on the site or any of the files for several months. If you tick the checkmark in the ReCaptacha box you will get the error "Validation Required!" which is the response given if the validation should fail as you can see in the code bellow.
Anyone got any idea why it would stop working just out of the blue when 0 changes has been done? I have had 10 different people try to use the contact form but everyone get's "Validation Required!" as an error.
Can recaptacha get blocked by the server firewall or something?
//reCAPTCHA validation
if (isset($_POST['g-recaptcha-response'])) {
require('component/recaptcha/src/autoload.php');
$recaptcha = new \ReCaptcha\ReCaptcha(SECRET_KEY, new \ReCaptcha\RequestMethod\SocketPost());
$resp = $recaptcha->verify($_POST['g-recaptcha-response'], $_SERVER['REMOTE_ADDR']);
if (!$resp->isSuccess()) {
$output = json_encode(array('type'=>'error', 'text' => '<b>Captcha</b> Validation Required!'));
die($output);
}
}
I'm having exactly the same problem :-(
Make sure you don't use www for non-www recaptcha.
the same problem, only the error is different ... Someone got into the codes on Google.
me too but for me it only works locally :/
same issue here
Same issue here.
I pushed an update back in March, could you verify you're on the latest version of the library and if that fixes the issue?
same issue. in local works. but in server error validation.