I've got a Google recapture that refuses to accept my answers (error: incorrect-captcha-sol) yet I think I've test every step without any problems. Its on a simple HTML/CSS type site.
- I can see in Firebug that the response and challenge are being sent from the contact form.
- I've echoed back the fields in php and they are the same I'm sending (match firebug)
- I've got a table on the same page but its not part (or in any way related) to the contact form.
HTML code:
<!-- Contact Form --> <div class="row"> <div class="span9"> <form id="contact-form" class="contact-form" action="#"> <p class="contact-name"> <input id="contact_name" type="text" placeholder="Full Name (Required)" value="" name="name" /> </p> <p class="contact-email"> <input id="contact_email" type="text" placeholder="Email Address (Required)" value="" name="email" /> </p> <p class="contact-message"> <textarea id="contact_message" placeholder="Your Message (Required)" name="message" rows="15" cols="40" maxlength="150"></textarea> </p> <p class="contact-challenge"> <div id="recaptcha_widget" style="display:none"> <div id="recaptcha_image"></div> <div class="recaptcha_only_if_incorrect_sol" style="color:red">Incorrect please try again</div> <span class="recaptcha_only_if_image">Enter the words above:</span> <span class="recaptcha_only_if_audio">Enter the numbers you hear:</span> <input id="recaptcha_response_field" type="text" name="recaptcha_response_field" /> <div><a href="javascript:Recaptcha.reload()">Get another CAPTCHA</a></div> <div class="recaptcha_only_if_image"><a href="javascript:Recaptcha.switch_type('audio')">Get an audio CAPTCHA</a></div> <div class="recaptcha_only_if_audio"><a href="javascript:Recaptcha.switch_type('image')">Get an image CAPTCHA</a></div> <div><a href="javascript:Recaptcha.showhelp()">Help</a></div> </div> </p> <script type="text/javascript" src="http://www.google.com/recaptcha/api/challenge?k=XXXX"> </script> <noscript> <iframe src="http://www.google.com/recaptcha/api/challenge?k=XXXX" 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> <p class="contact-submit"> <a id="contact-submit" class="submit" href="#">Send</a> </p> <div id="response"> </div> </form> </div> PHP
require_once('recaptchalib.php'); $privatekey = "XXXX"; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], $details["recaptcha_challenge_field"], $details["recaptcha_response_field"]); if (!$resp->is_valid) { // What happens when the CAPTCHA was entered incorrectly $this->response_html .= '<p>The code you entered was incorrect, please try again. ' . $resp->error . '</p>'; $this->response_status = 0; } Thanks