ini_set ('display_errors', '1'); ini_set ('error_reporting', E_ALL); $ip = $_SERVER['REMOTE_ADDR']; $fullhost = gethostbyaddr($ip); $host = preg_replace("/^[^.]+./", "*.", $fullhost); $_POST['email']=preg_replace("/\r/","",$_POST['email']); $_POST['email']=preg_replace("/\n/","",$_POST['email']); $find = array("/bcc\:/i","/Content\-Type\:/i","/cc\:/i","/to\:/i"); $_POST['email'] = preg_replace($find, "", $_POST['email']); $name = $_POST['name']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $zipcode = $_POST['zipcode']; $phone = $_POST['phone']; $email = $_POST['email']; $comments = $_POST['comments']; $msg = $name . "\n"; $msg .= $address . "\n"; $msg .= $city . ', ' . $state . ' ' . $zipcode . "\n"; $msg .= 'EMAIL: ' . $email . "\n"; $msg .= 'PHONE: ' . $phone . "\n\n"; $msg .= 'COMMENTS: ' . $comments . "\n\n"; $msg .= $ip . "\n"; $msg .= $fullhost . "\n"; $msg .= $host . "\n"; $mailheaders = 'From: ' . $email ."\r\n"; $mailheaders .= 'Reply-To: ' . $email ."\r\n"; $msg = preg_replace($find, "", $msg); mail('chaswill@bayou.com', 'ECPS Contact Form', $msg, $mailheaders); header ('Location: index.php');