Tampa Civil Design, Inc. |
|
We have received your message. If required, we'll get back to you as soon as possible.
EOD; /* URL to be redirected to after the form is submitted. If this is specified, then the above message will not be shown and user will be redirected to this page after the form is submitted */ /* Example: $thank_you_url = 'http://www.yourwebsite.com/thank_you.html'; */ $thank_you_url = ''; /******************************************************************************* * Do not change anything below, unless of course you know very well * what you are doing :) *******************************************************************************/ $name = array('Name','name',NULL,NULL); $email = array('Email','email',NULL,NULL,NULL); $subject = array('Subject','subject',NULL,NULL); $message = array('Message','message',NULL,NULL); $code = array('Code','captcha_code',NULL,NULL,NULL); $error_message = ''; if (!isset($_POST['submit'])) { showForm(); } else { //form submitted $error = 0; if(!empty($_POST['name'])) { $name[2] = clean_var($_POST['name']); if (function_exists('htmlspecialchars')) $name[2] = htmlspecialchars($name[2], ENT_QUOTES); } else { $error = 1; $name[3] = 'color:#FF0000;'; } if(!empty($_POST['email'])) { $email[2] = clean_var($_POST['email']); if (!validEmail($email[2])) { $error = 1; $email[3] = 'color:#FF0000;'; $email[4] = 'Invalid email'; } } else { $error = 1; $email[3] = 'color:#FF0000;'; } if(!empty($_POST['subject'])) { $subject[2] = clean_var($_POST['subject']); if (function_exists('htmlspecialchars')) $subject[2] = htmlspecialchars($subject[2], ENT_QUOTES); } else { $error = 1; $subject[3] = 'color:#FF0000;'; } if(!empty($_POST['message'])) { $message[2] = clean_var($_POST['message']); if (function_exists('htmlspecialchars')) $message[2] = htmlspecialchars($message[2], ENT_QUOTES); } else { $error = 1; $message[3] = 'color:#FF0000;'; } if(empty($_POST['captcha_code'])) { $error = 1; $code[3] = 'color:#FF0000;'; } else { include_once "securimage.php"; $securimage = new Securimage(); $valid = $securimage->check($_POST['captcha_code']); if(!$valid) { $error = 1; $code[3] = 'color:#FF0000;'; $code[4] = 'Incorrect code'; } } if ($error == 1) { $error_message = 'Please correct/enter field(s) in red.'; showForm(); } else { if (function_exists('htmlspecialchars_decode')) $name[2] = htmlspecialchars_decode($name[2], ENT_QUOTES); if (function_exists('htmlspecialchars_decode')) $subject[2] = htmlspecialchars_decode($subject[2], ENT_QUOTES); if (function_exists('htmlspecialchars_decode')) $message[2] = htmlspecialchars_decode($message[2], ENT_QUOTES); $message = "$name[0]: $name[2]\r\n$email[0]: $email[2]\r\n\r\n$message[0]:\r\n$message[2]\r\n"; if (!$from) $from_value = $email[2]; else $from_value = $from; $headers = "From: $from_value" . "\r\n" . "Reply-To: $email[2]"; mail($to,"$subject_prefix - $subject[2]", $message, $headers); if (!$thank_you_url) { include $header_file; echo $GLOBALS['thank_you_message']; echo "\n"; include $footer_file; } else { header("Location: $thank_you_url"); } } } //else submitted function showForm() { global $name, $email, $subject, $message, $code, $header_file, $footer_file, $form_width, $form_background, $form_border_color, $form_border_width, $form_border_style, $cell_padding, $left_col_width, $font_size; include $header_file; echo $GLOBALS['error_message']; echo <<
{$name[0]} | |
{$email[0]} | {$email[4]} |
{$subject[0]} | |
{$message[0]} | |
{$code[0]} | {$code[4]}
(Please enter the text in the image above. Text is not case sensitive.) Click here if you cannot recognize the code. |
All fields are required. | |