javascriptRecaptcha always failing on the second time

I'm loading Recaptcha using this:

<script src="//"></script>

and using AJax and PHP to validate the response:

curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, array(
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
[email protected]_exec($ch);

    die('The verification code is incorrect.');

For some reason, if I enter the Captcha incorrectly, then re-enter it correctly, the verification always returns "false". How do I allow the user the resubmit the Recaptcha response (without reloading the image) if they entered it incorrectly the first time?

You can't. The user cannot be given a second attempt at a reCaptcha challenge — if they get one wrong, they will need to attempt a different one the next time. For a web form, this should typically be implemented by redisplaying the form with an error message if the reCaptcha challenge fails, rather than forcing the user to use the "Back" button.

Related Articles
You Might Also Like