Friday, 3 June 2016

php - How to access Recaptcha Parameters [ recaptcha_challenge_field and recaptcha_response_field ]?

I am new in using the Google Recaptcha Web service to block spamming in some web pages in my web site plus doing that using AJAX by merging Javascript and PHP to response to my web page.



I read all the information related to it in the following link and I carried out the steps and everything was correct.



Google Code recaptcha Documentation




The problem I faced is the two fields used in the Verification process
[recaptcha_challenge_field and recaptcha_response_field]



When I call the recaptcha_check_answer function in verify.php it gives me the following error:-




incorrect-captcha-sol




Which means that [recaptcha_challenge_field and recaptcha_response_field] are null and not defined.




These two fields and variables should have the input in the reCAPTCHA PHP library I used during its process and should have getters to have them and pass in the mentioned function.



I searched the php file recaptchalib.php for that but I did not find it.



Should I add new input elements of hidden type and rename them with recaptcha_challenge_field and recaptcha_response_field to store the recaptcha parameters ?



I wonder how I can pass them in a correct way as I leave them as the guide said but it did not work properly. Did I need to define new variables for them and how to link them with the actual recaptcha parameters.



I would like to ask who implemented recaptcha and used it before to tell me how to solve that and I appreciate your help and Thanks in advance for your answer

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...