error_reporting(E_ALL ^ E_NOTICE);
$nav='contact';
$postback=false;
$content_include = 'content_contact.php';
//process mail if postback
if ( !empty($_POST) )
{
$postback=true;
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$comments=$_POST['comments'];
$emailRx ="/^([\w\d\-\.]+)@{1}(([\w\d\-]{1,67})|([\w\d\-]+\.[\w\d\-]{1,67}))\.(([a-zA-Z\d]{2,4})(\.[a-zA-Z\d]{2})?)$/";
if ( empty($name))
{
$errInput = "Please enter your name.";
}
elseif (empty($email) AND empty($phone) )
{
$errInput = "Please enter an email address or phone number so that we may respond to you.";
}
elseif (!empty($email) AND !preg_match($emailRx, $email))
{
$errInput = "The submitted email address does not appear to be a valid address.";
}
if (!$errInput)
{
$to = 'parksmail@cox.net;mgblagg@geotex.com';
$from = 'GeoTex,Inc.';
$replyto = $email;
$body = "An inquiry has been made from the geotex.com website:\r\n"
."Name: $name\r\n"
."Phone: $phone\r\n"
."Email: $email\r\n"
."Comments: $comments\r\n";
$headers = 'From: '. $from . "\r\n" .
'Reply-To: ' . $replyto . "\r\n" ;
$email_success = mail($to,
'Request from GeoTex.com ',
$body,
$headers);
}
}
//end process mail;
include ('header.php');
?>
if($postback):
if ($errInput):
?>
=$errInput?>
else:
if ($email_success):
?>
Thank you for your inquiry.
else:
#email failed
?>
We're sorry! For technical reasons your request failed. Please try again later.
endif;
endif;
endif;
#not a postback, show form
?>
Question or comment? We look forward to hearing from you.
Your contact information will be kept confidential.
GeoTex, Inc
6700A Davis Blvd
Forth Worth, TX 76180
Phone: (817) 656-9797
Fax: (817) 656-9191
include ('footer.php'); ?>