Thursday, February 7, 2013

I keep getting "incorrect-captcha-sol" even though I'm entering the correct words in reCaptcha


I keep getting "incorrect-captcha-sol" even though I'm entering the correct words

You are probably not passing in the user's input into the verification routine because you're not getting them from the previous step. You should be ensuring the contents of (in PHP, other languages may differ in syntax) $_POST['recaptcha_response_field'] and$_POST['recaptcha_challenge_field'] are not empty or null before calling the verification routine anyway

.
Reasons this may be happening include:
  • You are expecting the input to come from POST, but your input form specifies the method as GET (or you've not specified it at all, in which case it will default to GET)
  • You have placed your input <form> in a <table> (the table should be in the form) in your input code
  • You have typo'd either of the POST variables in your verification code.
When posting about this problem to the list, please supply the output of the following (PHP - provide similar for other languages please) debug code which should go directly before any call to recaptcha_check_answer() or any other call that submits the entered input for verification:
<?php
echo "<pre> _POST: =========\n";
print_r($_POST);
echo "\n=========\n</pre>";
?>
Example output from the above on a form that also has a user, two password entries and an email:
 _POST: =========
Array
(
    [user] => asdfghjk
    [password] => asdf
    [password2] => asdf
    [email] => 
    [recaptcha_challenge_field] => 03AHJ_VuvGHdNKNYZCZt_MJ6EDiDNdorrvARpUiuQ2OjZ4y2zR_ejuRGW5zPGPaHVDg_sywkAuA3rsMKoKNjMzUvNjxWAs8G8DBVexQKuKanfvFIt0uFj2LfEU6KKwHNDONM_MJpn01fBHnRxhhvHwbt4fL__7Q_dmvA
    [recaptcha_response_field] => jerespe zollner:
)
=========

No comments: