I have a form which is validated via jQuery, then ajaxed to a php file to send the email.
However, due to a lot of spamming I now require a reCAPTCHA in place. I have registered with http://www.google.com/recaptcha.
Now I have no clue how to implement it. I which to be able to ajax to a php file and get the response of either "correct开发者_C百科" or "incorrect" then display the appropriate message via jQuery.
So far I have managed to get the reCAPTCHA displaying by using this code:
<script type="text/javascript" src="http://api.recaptcha.net/challenge?k=PUBLIC_KEYvz"></script>
<noscript>
<iframe src="http://api.recaptcha.net/noscript?k=PUBLIC_KEY"
height="300" width="500" frameborder="0"></iframe>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge">
</noscript>
Now I just do not know where to go from here. I am very new to all this reCAPTCHA stuff so please be specific with me. Thanks a lot!
It is laid out in incredibly specific detail in the documentation.
http://code.google.com/apis/recaptcha/docs/php.html
Get it working like that first, then start messing with doing it in jquery and ajax. You're not even CLOSE at the moment. And I doubt if anyone is going to write it all for you.
As usual... Google always has lots of answers, and SO:
http://snipplr.com/view/15563/jquery-validating-recaptcha-with-ajax/
PHP - Question about using reCAPTCHA with jQuery
精彩评论