sql_query("select * from diseases where new='1' order by position"); $diseases = $db->fetched_array(); $smarty->assign("diseases",$diseases); //solutions $db->sql_query("select * from solutions where new='1' order by position"); $solutions = $db->fetched_array(); $smarty->assign("solutions",$solutions); if(isset($_POST['name']) and isset($_POST['message']) and isset($_POST['email']) and isset($_POST['address'])) { if($_POST['secretNumber']!=$_SESSION['key']) { $smarty->assign("name",$_POST['name']); $smarty->assign("email",$_POST['email']); $smarty->assign("address",$_POST['address']); $smarty->assign("body",$_POST['message']); $smarty->assign("err","Wrong number!"); } else { $db->sql_query("select * from vars where id='admin_email'"); $email = $db->fetch_item("value"); $to_email=$email; $subject = "Contact Form Submission from ".S_PROJECT_NAME; $from_name = S_PROJECT_NAME; $from_email = "noreply@detamed.xi-digital.com"; $to_name = "Website administrator"; $headers = "From: $from_name<$from_email>\n"; $headers .= "Reply-To: <$from_email>\n"; $headers .= "MIME-Version: 1.0\n"; $message = "Contact form has been submited by ".$_POST['name'].", ".$_POST['email']."\n\n\n"; $message .= "Name: ".$_POST['name']."\n"; $message .= "Address: ".$_POST['address']."\n"; $message .= "E-Mail: ".$_POST['email']."\n"; $message .= "Comments: ".$_POST['message']."\n"; mail("$to_name<$to_email>", $subject, $message, $headers); $displaymessage=""; $smarty->assign("message",$displaymessage); } } $smarty->display("contact.html"); ?>