I'm trying to get my Captcha to work. It works, but if the user does it correctly I want them to go to my thanks.html page, and I'm doing something wrong. Help?
<?
require_once('recaptchalib.php');
$privatekey = "Private Key numbers";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
$to = 'myemail@myemail.com';
$subject = 'Comment Form Title';
$message = 'From: ' . $_REQUEST['name'] . "\n\n" . $_REQUEST['data'];
$email = $_REQUEST['email'];
$headers = 'From: ' . $email . "\r\n" .
'Reply-To: ' . $email . "\r\n" .
'X-Mailer: PHP/' . phpversion();
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 {
mail ($to, $subject, $message, $headers);
header("Location: thanks.html");
// Your code here to handle a successful verification
}
?>