Need help with reCAPTCHA - keep getting incorrect-captcha-sol

前端 未结 6 663
野的像风
野的像风 2020-12-06 12:25

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

相关标签:
6条回答
  • 2020-12-06 12:41

    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

    0 讨论(0)
  • 2020-12-06 12:43

    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.

    0 讨论(0)
  • 2020-12-06 12:44

    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.

    0 讨论(0)
  • 2020-12-06 12:49

    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.
    
    0 讨论(0)
  • 2020-12-06 12:53

    In my case, the error was to set the form without specifying:

    method="POST"

    Cheers!

    0 讨论(0)
  • 2020-12-06 13:04

    in root directory from the script set php.ini with this:

    allow_url_fopen = On

    0 讨论(0)
提交回复
热议问题