<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> </head> <body> <?php if(!empty($_REQUEST["email"])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = "kadian2010@gmail.com"; $email_subject = "Admission query details"; function died($error) { // your error code can go here echo "We are very sorry, but there were error(s) found with the form you submitted. "; echo "These errors appear below.<br /><br />"; echo $error."<br /><br />"; echo "Please go back and fix these errors.<br /><br />"; die(); } // validation expected data exists if(!isset($_REQUEST['name']) || !isset($_REQUEST['email']) || !isset($_REQUEST['phone']) || !isset($_REQUEST['course']) || !isset($_REQUEST['city']) || !isset($_REQUEST['comments']) || !isset($_REQUEST['security_code'])) { died('We are sorry, but there appears to be a problem with the form you submitted.'); } $first_name = $_REQUEST['name']; // required $email_from = $_REQUEST['email']; // required $telephone = $_REQUEST['phone']; // required $course = $_REQUEST['course']; // required $city = $_REQUEST['city']; // required $comments = $_REQUEST['comments']; // not required $security = $_REQUEST['security_code']; // not required $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "First Name: ".clean_string($first_name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Telephone: ".clean_string($telephone)."\n"; $email_message .= "Course: ".clean_string($course)."\n"; $email_message .= "City: ".clean_string($city)."\n"; $email_message .= "Comments: ".clean_string($comments)."\n"; $email_message .= "Security_Code: ".clean_string($security)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($email_to, $email_subject, $email_message, $headers); echo"Thank you for contacting us. We will be in touch with you very soon."; } else{ echo"Please first fill the Enquiry Form correctively"; } ?> <br /><br> <a href="http://admissioncart.dx.am/contact-us.php">Click here</a> to Contact Us </body> </html>
!empty($_REQUEST["email"])
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)