Google Recaptcha - Keep Getting 'Incorrect-Captcha-Sol'

Google reCAPTCHA - keep getting `incorrect-captcha-sol`

I have solved this, it is one of the most unusual things I have come across, my syntax was previously:

<table>
<form>
<tr><td></td></tr>
</form>
</table>

I changed it to this:

<form>
<table>
<tr><td></td></tr>
</table>
</form>

Because of this switch, suddenly the recaptcha_response_field and recaptcha_challenge_field are posting values back to the form.

I cannot think why this because all MY form variables got posted back before the switch.

Thanks all for the pointers.

Google reCAPTCHA: incorrect-captcha-sol error

I solved the issue using the following code

$response=json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=SECRET_KEY_HERE&response=".$captcha."&remoteip=".$_SERVER['REMOTE_ADDR']), true);
if($response['success'] == false){
//Captcha incorrect
}
else {
//Success code here
}

instead of

<?php
require_once('recaptchalib.php');

$privatekey = "xxx";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);

if (!$resp->is_valid) {
die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
"(reCAPTCHA said: " . $resp->error . ")");
} else {
/* proper code */
}
?>

Thanks to Locke Donohoe who suggested the answer here.

Google Recaptcha incorrect-captcha-sol

I eventually figured it out I didn't initialize $resp before I used it.
So I've now got

$resp = null;

before the start of the IF statement and the code is now working correctly.

That's what I get for copy/pasting Google's code and not checking it carefully!

Google recaptcha v3 with codeigniter 3 - incorrect-captcha-sol

This is solved. Here is the solution.
Instead of assigning constant keyword to a php variable, i have echo directly the Constant Keyword.

reCAPTCHA keep saying incorrect-captcha-sol

Fixed it by ending a table before the form then starting the table again once inside the form.



Related Topics



Leave a reply



Submit