Please fill out name, phone and email fields prior to submitting the form.
";
}
else // check captcha
{
if ($_SESSION['security_code'] == stripslashes($_POST['phrase']) && !empty($_SESSION['security_code']))
{
unset($_SESSION['security_code']);
$goodCaptcha = true;
}
else
{
// invalid code entered
unset($_SESSION['security_code']);
$errorMsg = "You seem to have entered an incorrect spam prevention phrase. Please enter the letters you see in the image.
";
}
}
if ($goodCaptcha == true) // go ahead and process the form
{
$messageToSend = 'A visitor has sent email using the contact form on ' . $_SERVER["HTTP_HOST"] . '
Here is the information they submitted:
---------------------------------------
Name: ' . stripslashes($fullName) . "
";
if ($company != '')
{
$messageToSend .= "Company: " . stripslashes($company) . "
";
}
if ($address != '')
{
$messageToSend .= "Address: " . stripslashes($address) . "
";
$messageToSend .= "City, State, Zip, Country: " . stripslashes($city) . ", " . stripslashes($state) . " " . stripslashes($zip) . " " . stripslashes($country) . "
";
}
if ($phone != '')
{
$messageToSend .= "Phone: " . stripslashes($phone) . "
";
}
if ($email != '')
{
$messageToSend .= "Email: " . stripslashes($email) . "
";
}
if ($message != '')
{
$messageToSend .= '
---------------------------------------
Message:
'.stripslashes($message).'
';
}
$headers = "From: " . $fromAddress . " <" . $fromAddress . ">\r\n";
@mail($toAddress, $subject, $messageToSend, $headers);
header("Location: contact-us-thanks.html");
}
}
?>