require_once('recaptchalib.php');
// Get a key from https://www.google.com/recaptcha/admin/create
$publickey = "6LfV5csSAAAAAPI-ZyKpFEkIokeazOLsRb0OYOvP";
$privatekey = "6LfV5csSAAAAAHTSwqbp5RuQ9KjeLsGFOzAeay2G";
# the response from reCAPTCHA
$resp = null;
# the error code from reCAPTCHA, if any
$error = null;
if($do == "submit_contact")
{
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if ($resp->is_valid) {
$valid = "Y";
} else {
# set the error code so that we can display it
$error = "You have entered the incorrect words from the image";
}
if (!$error)
{
$message = nl2br($message);
$htmlmessage.="This message was sent from the customer service form on the website. ";
$htmlmessage.="Name: $firstname $lastname
";
if ($company)
$htmlmessage.="Company: $company
";
if($email)
$htmlmessage.="Email: $email
";
if($phone)
$htmlmessage.="Phone: $phone
";
if($message)
$htmlmessage.="Message: $message
";
include_once("class.phpmailer.php");
$mail = new PHPMailer();
$mail->From = $email;
$mail->FromName = "$firstname $lastname";
$mail->AddAddress("ian@spice-quest.com");
$mail->IsHTML(true);
$mail->Subject = "Spice Quest Contact";
$mail->Body = $htmlmessage;
$mail->Send();
header("location: thanks.php");
exit;
}
}
include_once("topnav.inc");
?>