Feedback Assaroe Falls
if(isset($_POST['submit_1'])) { // Data cleaning function function clean_data($string) { if (get_magic_quotes_gpc()) { $string = stripslashes($string); } $string = strip_tags($string); return mysql_escape_string($string); } // Mail header removal function remove_headers($string) { $headers = array( "/to\:/i", "/from\:/i", "/bcc\:/i", "/cc\:/i", "/Content\-Transfer\-Encoding\:/i", "/Content\-Type\:/i", "/Mime\-Version\:/i" ); $string = preg_replace($headers, '', $string); return strip_tags($string); } // check that we have the right info if($_POST['first_name'] == '' || $_POST['email'] == '' ||$_POST['question'] == '') { echo 'Sorry - but we need at least your first name, email address and - of course - your question!
Please return to the contact form and complete the missing fields.
'; } else { $title = clean_data($_POST['title']); $first_name = clean_data($_POST['first_name']); $last_name = clean_data($_POST['last_name']); $email = clean_data($_POST['email']); $phone_code = clean_data($_POST['phone_code']); $phone_number = clean_data($_POST['phone_number']); $mob_phone_code = clean_data($_POST['mob_phone_code']); $mob_phone_number = clean_data($_POST['mob_phone_number']); $question = clean_data($_POST['question']); $title = remove_headers($title); $first_name = remove_headers($first_name); $last_name = remove_headers($last_name); $email = remove_headers($email); $phone_code = remove_headers($phone_code); $phone_number = remove_headers($phone_number); $mob_phone_code = remove_headers($mob_phone_code); $mob_phone_number = remove_headers($mob_phone_number); $question = remove_headers($question); $name = $title.' '.$first_name.' '.$last_name; $phone = $phone_code.'-'.$phone_number; $mobile = $mob_phone_code.'-'.$mob_phone_number; $time = time(); // mail with the query $to = 'david@ticktockdesign.com'; $from = $email; $subject = 'Web inquiry from your website'; $send_message = "You have received an inquiry from the website.\n\nFrom: ".$name."\nEmail: ".$email."\nContact Number: ".$phone."\nMobile Phone: ".$mobile."\nMessage: ".$question."\n\n"; $headers = "From: <" . $from . ">\n"; $headers .= "Return-Path: <" . $from . ">\n"; // Return path for errors $headers .= "X-Sender: <" . $from . ">\n"; if(mail($to, $subject, $send_message, $headers)) { echo 'Thank you!
Thank you for contacting Assaroe Falls. We will respond to your inquiry as soon as possible; in the mean time, please do take a look around the site.
'; // insert into database $insert = mysql_query("INSERT into af_inqs (date, title, first_name, last_name, email, phone_code, phone_number, mob_phone_code, mob_phone_number, question) VALUES ('".$time."', '".$title."', '".$first_name."', '".$last_name."', '".$email."', '".$phone_code."', '".$phone_number."', '".$mob_phone_code."', '".$mob_phone_number."', '".$question."')"); } else { echo 'Problem sending your message!
Sorry, but there seemed to be a problem sending your message. Probably the best thing to do would be to write directly to us using info@assaroefalls.com, or call us on +353 (0)71 98 22 123
'; } } } else { ?>We welcome your feedback in all elements of the experience in Assaroe Falls.
Please take the time to complete the short sets of questions below, and feel free to leave a fuller review in the comments section at the end. Thanks very much!
} ?>