"Contact Us", "keywords" => "", "description" => "", "name" => "" ); $page_url="contact"; $level=1; $page_id=0; $rsfather=0; require "header.php"; require "sidebar.php"; $error=array(); if (isset($_POST['ems_fname'])) { $lead=array(); if (strlen(trim($_POST['ems_fname']))>0) $lead['fname']=trim($_POST['ems_fname']); else $error[]="First Name field is empty."; if (strlen(trim($_POST['ems_lname']))>0) $lead['lname']=trim($_POST['ems_lname']); else $error[]="Last Name field is empty."; if ((is_numeric($_POST['ems_phone_1']) || is_numeric(trim($_POST['ems_phone_1']))) && (is_numeric($_POST['ems_phone_2']) || is_numeric(trim($_POST['ems_phone_2']))) && (is_numeric($_POST['ems_phone_3']) || is_numeric(trim($_POST['ems_phone_3'])))) { $lead['phone_1']=trim($_POST['ems_phone_1']); $lead['phone_2']=trim($_POST['ems_phone_2']); $lead['phone_3']=trim($_POST['ems_phone_3']); } else $error[]="Phone field must be a valid phone number, and contain only numbers."; /*if (preg_match("/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,})*\.([a-zA-Z]{2,}){1}$/", $_POST['ems_email'])) $lead['email']=$_POST['ems_email']; else $error[]="Email field must contain a real email address.";*/ if (isset($_POST['ems_email']) && $_POST['ems_email']!="") $lead['email']=$_POST['ems_email']; else $lead['email']=""; if (strlen($_POST['ems_state'])>0) $lead['state']=$_POST['ems_state']; else $error[]="State field is empty."; if (strlen($_POST['ems_city'])>0) $lead['city']=trim($_POST['ems_city']); else $error[]="City field is empty."; if (strlen($_POST['ems_street'])>0) $lead['street']=trim($_POST['ems_street']); else $error[]="Street field is empty."; if (strlen($_POST['ems_zip'])==5 && is_numeric($_POST['ems_zip'])) $lead['zip']=$_POST['ems_zip']; else $error[]="Zip code field must be a valid zip code, and contain 5 numbers."; $lead['info']=trim($_POST['ems_info']); $at=time(); } if (isset($_POST['ems_fname']) && count($error)==0) { if (get_magic_quotes_gpc()) { foreach ($lead as $k=>$v) { $lead[$k]=stripslashes($lead[$k]); } } foreach ($lead as $k=>$v) { $lead[$k]=mysql_real_escape_string($lead[$k]); } /*foreach ($ecu as $k=>$v) { $ecu[$k]=htmlspecialchars($ecu[$k]); }*/ $result=mysql_query("insert into `contacts` (`name`, `telephone`, `email`, `address`, `city`, `state`, `zip`, `apply`, `at`) values ('".$lead['fname']." ".$lead['lname']."', '".$lead['phone_1'].$lead['phone_2'].$lead['phone_3']."', '".$lead['email']."', '".$lead['street']."', '".$lead['city']."', '".$lead['state']."', '".$lead['zip']."', '".$lead['info']."', ".time().")") or die ("Problems in query. ".mysql_error()); echo "

Thank you for writing to us at plumberchicagoil.com. We value each and every email from our users. Our company's representative will contact you shortly.

"; require_once "piwik_goal.php"; } else { ?>