die(); include('includes/connect.php'); if($_POST['submitform']) { $required_fields = array("name", "email", "enquiry"); // Check for empty fields foreach($_POST as $key => $value) { if (in_array($key, $required_fields)) { if ($value == NULL) { $error_message = "Please complete '" . $key . "'"; } } } // Check for valid Email if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $_POST['email'])) { $error_message = "Email address provided is not valid"; } // Anti Spam Measure if(!empty($_POST['email_conf'])) { $error_message = "Please complete all fields"; } if (!$error_message) { $headers = "From: " . $_POST['name'] . " < " . $_POST['email'] . " >\r\n"; $headers .= "Reply-To:" . $_POST['name'] . " < " . $_POST['email'] . " >\r\n"; $headers .= "Content-type: text/html;charset=ISO-8859-9\n"; $subject = "PNG Tours website enquiry"; //$to = "adam@destination-specific.com.au"; //$to = "adam.nurk@gmail.com"; $to = "service@pngtours.com"; $body = "
$key | " . str_replace("\n", " ", $array) . " | \r\n";
$body .= "
Thank you, we have received your enquiry successfully. A representative will be in contact with you shortly
"; else { ?>Please fill out the form below and we will get back to you as soon as possible.
Note: * are compulsory fields
if($error_message) echo "" . $error_message . "
";?> } } ?>