session_start();
include_once 'scripts/recaptchalib.php';
$publickey = '6LdZmwYAAAAAALv8x5ZpVOpvJvoKid6UfbNzAnBV';
$notice = '';
// If send form field is triggered
if (isset($_POST['send'])) {
// reCAPTCHA Private Key
$privatekey = "6LdZmwYAAAAAAP0bIVBb5RNdvBrvbDWiXSGxxrwV";
// Check empty fields
foreach ($_POST as $key => $val)
$$key = addslashes($val);
if (empty($name))
$notice .= "Please enter your name.
";
if (empty($email))
$notice .= "Please enter your email address.
";
if (empty($message))
$notice .= "Please enter your message.
";
// Validate Email
if (!is_email($email))
$notice .= "Email is not a valid format.
";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
$notice .= "The reCAPTCHA wasn't entered correctly. Go back and try it again.";
}
$message = stripslashes(nl2br($message));
// If no errors, proceed
if (empty($notice)) {
$body_html = "
Name: $name
Email: $email
Message:
$message";
$body = strip_tags($body_html);
include_once '/home/httpd/common/contact.php';
smail_html($contactConfig[$type]['address'], $contactConfig[$type]['name'], $email, $name, $email, $_SERVER['HTTP_HOST'] . ' ' . $contactConfig[$type]['subject'], $body, $body_html);
//smail_html('en@ataramedia.com', 'Edmund', $email, $name, $email, $subject, $body, $body_html);
$notice = '