D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
probwael
/
www
/
Filename :
postmail4.php
back
Copy
<?php session_cache_expire(120); ini_set('session.gc_maxlifetime', 7200); @session_start(); function spamcheck($field) { $field=filter_var($field, FILTER_SANITIZE_EMAIL); if(filter_var($field, FILTER_VALIDATE_EMAIL)) { return TRUE; } else { return FALSE; } } $mailcheck = spamcheck($_REQUEST['email']); $email = strip_tags($_REQUEST['email']); $pid = strip_tags($_REQUEST['pid']); $phone = strip_tags($_REQUEST['phone']); $message = strip_tags($_REQUEST['message']); $name = strip_tags($_REQUEST['name']); $spam1 = strip_tags($_REQUEST['spam1']); $spam2 = strip_tags($_REQUEST['spam2']); if($name=='' or $message=='') { $_SESSION["msg"]= "<br><font color=red>One or more required inputs missing... Try again!</font><br><br>"; header("location: ad_detail?pid={$pid}#goto"); } else if ($mailcheck==FALSE) { $_SESSION["msg"]= "<br><font color=red>Invalid email address format. try again!</font><br><br>"; header("location: ad_detail?pid={$pid}#goto"); } else if($spam1!==$spam2) { $_SESSION["msg"]= "<br><font color=red>Invalid anti-spam code supplied... Try again!</font><br><br>"; header("location: ad_detail?pid={$pid}#goto"); } else { //send email $subject="Property Enquiry from - ".$name; $details="Sender: ".$name."\n"."Email Address: ".$email."\n"."Phone number: ".$phone."\n\n".$message; @mail("info@snsoproperty.com", $subject, $details, "From: $email"); $_SESSION["msg"]= "<br><font color=green><b>Your message was delivered successfully!</b> <br>We'll get back to you as soon as possible.</font><br><br>"; header("location: ad_detail?pid={$pid}#goto"); } ?>