'; print_r($str); echo ''; } /*****************************************************************/ /******************** form is submitted ***************************/ if ($_POST['action'] == 'process'){ // validate required fields $missing = array(); // missing vals $err = array(); // merge all errs for display $aReq = explode(",",$_POST['areq']); foreach ($aReq as $r){ if (!$_POST[$r]){ $missing[] = ucfirst(str_replace("_"," ",$r )) . ' is required.'; } } if ($_POST['email'] && !isValidEmail($_POST['email']) ){ $err[] = 'Email is incorrectly formed.'; } // clean for email injection foreach( $_POST as $value ){ if( is_array($value) === false && strpos($value,'Content-Type:') !== FALSE ){ $spam = true; } } // get all errors and put them in one clean var for output $allErr = array_merge($missing,$err); $message = @implode('
',$allErr); // send email if (!$spam && !$message){ $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=ISO-8859-1\n"; $headers .= "From: ".$_POST['email'] ." \r\n"; $body = date('F j, Y h:i:s A'). '
' .chr(10); $body .= 'The following form has been submitted.

' .chr(10).chr(10); foreach ($_POST as $FormFieldName=>$FormFieldValue) { // dont send theses $skipArr = array ('action','areq','submit'); if (is_array($_POST[$FormFieldName])){ $FormFieldValue = @implode("
",str_replace("_"," ",$FormFieldValue)); } if (in_array($FormFieldName,$skipArr) === false){ if ($FormFieldValue) { $body .= ucwords(str_replace("_"," ",$FormFieldName)) . ': ' . $FormFieldValue. '
' .chr(10); } } } mail($to,$subject, $body, $headers); if ($cc){ // send a copy to.... mail($cc,$subject, $body, $headers); } $message = 'Thank you for your submission'; $success = true; } // end send mail } // end if process David Gaffney - Realtor

FREE BUYERS REPORTS

Get FREE REPORTS from Dave by filling out this easy emailable form.

Information provided by the consumer is only used for the purpose of responding to inquiries; it is never sold or shared.

Buyer's Reports

Check the report you want Dave to send you:

Critical Questions for Buyers
Buyers Most Common Mistakes

 

                           - CONTACT DAVE -                             icons CRS
real
Dave Gaffney - Licensed in Missouri - CoMo Realty
(573)443-6736 - Fax: 443-8188 - Email: thebetteragent.net
Contents© 2010 David Gaffney
Gaffney & Associates