I am trying to add a reCAPTCHA to my site, but keep getting incorrect-captcha-sol
error when I submit the answer.
Can anyone tell me if I am correct in
if you are posting the check twice - eg once from javascript and once via php the second one will fail as the API only allows a solution to return valid once.
Hope that helps, Josh
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.
That's because the form cannot be on the outside of the tr.....it has to be on the outisde of table.....form cannot be inserted into table, it can be inserted into the td though.
Are you sure you are typing in correct words?
this one is from recaptcha website :
Line 1 "true" or "false". True if the reCAPTCHA was successful
Line 2 if Line 1 is false, then this string will be an error code. reCAPTCHA can
display the error to the user (through the error parameter of api.recaptcha.net/challenge).
Implementations should not depend on error code names,
as they may change in the future.
Example: If your response looks like this:
false
**incorrect-captcha-sol**
... you can add '&error=incorrect-captcha-sol' to the challenge request URL,
and the user will get an error code.
In my case, the error was to set the form without specifying:
method="POST"
Cheers!
in root directory from the script set php.ini with this:
allow_url_fopen = On