$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 = ""; foreach($_POST as $key=>$array) { if($key != "x" && $key != "y") { $body .= "\r\n"; $body .= "\r\n"; $body .= "\r\n"; } } $body .= "
$key" . str_replace("\n", "
", $array) . "
"; mail($to, $subject, $body, $headers); $success_message = "Thank you, your enquiry was successful. We will get back to you shortly"; } } if(stristr($_GET['page'], ".html")) { $content = getCMSContentFromURL($_GET['page']); } $child_pages = getChildContent(2); $active_child = getActiveChild($_SERVER['QUERY_STRING'], $child_pages); if($active_child == 0) { // Redirect to first sub page //header('location: ' . FILE . '?/' . $child_pages[0]['PageID'] . '/' . urlencode(strtolower($child_pages[0]['Title']))); } else { $content = getCMSContent($active_child); } $content = fixLinks($content); include('includes/header.php'); ?>

Online Enquiry Form"; if($success_message) echo "

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

" . $error_message . "

";?>

Back to top