“incorrect-captcha-sol” error with reCAPTCHA PHP library

89 views
Skip to first unread message

Joe P

unread,
Dec 23, 2010, 8:34:35 PM12/23/10
to reca...@googlegroups.com

I am trying to get reCAPTCHA to work in my simple PHP script. I keep receiving the error incorrect-captcha-sol while processing the form and I am not sure what's going on. I've seen other people have issues when the form is within a table tag but that is not the case for me. Any ideas?

Here is the relevant portion of index.php (with key masked/randomized)

<div>
   
<form name="submit-complaint" action="process-complaint.php" method="post">
    What now?
   
<textarea name="complaint"></textarea>
   
<input type="submit" value="Complain" />
   
<div>
       
<?php
            require_once
('include/recaptchalib.php');
            $publickey
= "6LeaTb8-PUBLICKEY-T1XAsPQICozztsVj_kyS2t";
            echo recaptcha_get_html
($publickey);
       
?>
   
</div>
   
</form>
</div>

Here is the relevant portion of process-complaint.php with key masked/randomized

<?php
require_once
('include/recaptchalib.php');
$privatekey
= "MYPRIVATEKEY-ACZmGS_KUEXQBnq9YpTVp1Wzawj3";
$resp
= recaptcha_check_answer($privatekey,
                $_SERVER
["REMOTE_ADDR"],
                $_POST
["recaptcha_challenge_field"],
                $_POST
["recaptcha_respond_field"]);
if (!$resp->is_valid) { die($resp->error); }

//....
?>

Dom Sekotill

unread,
Dec 26, 2010, 6:25:13 PM12/26/10
to reca...@googlegroups.com
This error generally means one or both of the
"recaptcha_challenge_field" and "recaptcha_response_field" POST values
was empty. In your case I would say check your spelling, you have
"recaptcha_respond_field".

Reply all
Reply to author
Forward
0 new messages