############################################################# // Contacter V 0.1 | by Gordon Mackay | http://gordonmac.com/ ############################################################# ############################################################# // set your own preferences here ############################################################# // Your email address $youremail = 'resources@scoutreach.com.au'; // Your web site title (John Doe's Site) $websitetitle = 'scoutreach.com.au'; // Path to "thanks for the message" page $thankyoupage = 'thankyou.php'; // Send notification to sender (use false if not required) $sendnotification = true; ############################################################# // Do not edit below this ############################################################# $contact_form_action = $_SERVER['PHP_SELF']; if ((isset($_POST["sendcontact"])) && ($_POST["sendcontact"] == "contactsent")) { $contacter_form_error = array(); if (empty($_POST['contact_name'])){ $contacter_form_error[] = 'please insert your name'; } if (empty($_POST['contact_email'])){ $contacter_form_error[] = 'please insert your email address'; } if (empty($_POST['contact_comment'])){ $contacter_form_error[] = 'please insert your comment'; } else { $contact_name = stripslashes($_POST['contact_name']); $contact_email = stripslashes($_POST['contact_email']); $contact_comment = $contact_name." said:\n \"".stripslashes($_POST['contact_comment'])."\"\n"; $subjectline = "$websitetitle | A Message From $contact_name"; if(!empty($_POST['best_time'])) { $contact_comment .= '(Best time to contact is: '.stripslashes($_POST['best_time']).')'."\n"; } if(!empty($_POST['contact_phone'])) { $contact_comment .= '(Phone number is: '.stripslashes($_POST['contact_phone']).')'; } mail($youremail, $subjectline, $contact_comment, "From: $contact_email"); if($sendnotification == true) { $notification_message = "Thank you for contacting $websitetitle, $contact_name. We have received your email and will be in touch shortly"; $notification_subject = "Thanks for your message to $websitetitle."; mail($contact_email, $notification_subject, $notification_message, "From: $youremail"); } header("Location:$thankyoupage"); } } ?>