reCAPTCHA Problems

59 views
Skip to first unread message

Kreshnik Rexha

unread,
Sep 25, 2013, 7:14:20 AM9/25/13
to reca...@googlegroups.com
Hi I have implemented reCAPTCHA on the domain: www.moler-wwp.co.uk on the contact page

Code on the contact.html page:

inside form:

 <script type="text/javascript"
    </script>
       
         <noscript>
           height="300" width="500" frameborder="0"></iframe><br>
           <textarea name="recaptcha_challenge_field" rows="3" cols="50">
       </textarea>
           <input type="hidden" name="recaptcha_response_field"
           value="manual_challenge">
           </noscript>


My contact.php form which the form actions is:

<?php 

  require_once('recaptchalib.php');
  $privatekey = "PRIVATE KEY";
  $resp = recaptcha_check_answer ($privatekey,
                                $_SERVER["REMOTE_ADDR"],
                                $_POST["recaptcha_challenge_field"],
                                $_POST["recaptcha_response_field"]);

  if (!$resp->is_valid) {
    // What happens when the CAPTCHA was entered incorrectly
    die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." .
         "(reCAPTCHA said: " . $resp->error . ")");
  } else {
    // Your code here to handle a successful verification
$ToEmail = 'bob_...@moler-wwp.co.uk'; 
$EmailSubject = 'Site Contact Form'; 
$mailheader = "From: ".$_POST["email"]."\r\n"; 
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n"; 
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
$MESSAGE_BODY = "Name: ".$_POST["name"]."<br>"; 
$MESSAGE_BODY .= "Email: ".$_POST["email"]."<br>"; 
$MESSAGE_BODY .= "Address: ".$_POST["address"]."<br>"; 
$MESSAGE_BODY .= "Phone: ".$_POST["phone"]."<br>";
$MESSAGE_BODY .= "Message: ".nl2br($_POST["message"])."<br>"; 
mail($ToEmail, $EmailSubject, $MESSAGE_BODY, $mailheader) or die ("Failure"); 
  }

?>
<HTML>
<head>

<meta http-equiv="REFRESH" content="4;URL=contact.html"><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
body,td,th {
color: #000000;
font-family: Arial, Helvetica, sans-serif;
font-size: 1em;
}
body {
background-color: #CCCCCC;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: underline;
color: #666666;
}
a:active {
text-decoration: none;
color: #000000;
}
-->
</style></HEAD><body content="4;URL=contact.htm">

<bodyY>
<div align="center">
  <p>Your message was sent.</p>
  <p><a href="contact.html">BACK</a></p>
</div>
</body>
</html>


I keep getting this error message: 

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.


Any ideas?

Reply all
Reply to author
Forward
0 new messages