include('wolfson_func.php'); $REG = DoReg($WOLFSON_ID,$REG_INFO,$MESSAGE); $SEND=$_POST['SEND']; if (!$SEND) $SEND=$_GET['SEND']; $frer=$_POST['frer']; if ($REG && $SEND && $frer){ SubmitForm(); }elseif($REG){ PrintForm(); }else{ PrintPage(); } ############ #MailReport ############ function MailReport($EMAIL,$REPORT_FILE,$TITLE){ $REPORT=implode("\n", file($REPORT_FILE)); $MSG="$REPORT\n"; mail($EMAIL, "Requested report: $TITLE", $MSG, "From: bestagent@realtor.com \r\n"."Reply-To: bestagent@realtor.com\r\n"); } ############ #SubmitForm ############ function SubmitForm(){ global $frer; global $REG_INFO; global $MESSAGE; $EMAIL=$REG_INFO['EMAIL']; $REPORTS=''; $REPORTS_HTML=''; $nn=0; while($nn < count($frer) ){ $thisreport=$frer[$nn]; switch($thisreport) { case !ereg("How to Buy",$thisreport): MailReport("$EMAIL","how2buy.txt",$thisreport); $REPORTS.="EMAIL SENT:"; break; case !ereg("Secrets Lenders",$thisreport): MailReport("$EMAIL","lender.txt",$thisreport); $REPORTS.="EMAIL SENT:"; break; case !ereg("The Ultimate",$thisreport): MailReport("$EMAIL","ultimate.txt",$thisreport); $REPORTS.="EMAIL SENT:"; break; case !ereg("List Your Home Until",$thisreport): MailReport("$EMAIL","dontlist.txt",$thisreport); $REPORTS.="EMAIL SENT:"; break; case !ereg("Stop Paying Rent",$thisreport): MailReport("$EMAIL","how2stop.txt",$thisreport); $REPORTS.="EMAIL SENT:"; break; case !ereg("SELLERS BEWARE",$thisreport): MailReport("$EMAIL","sellersb.txt",$thisreport); $REPORTS.="EMAIL SENT:"; break; case !ereg("REPORT REVEALS",$thisreport): MailReport("$EMAIL","fsbo.txt",$thisreport); $REPORTS.="EMAIL SENT:"; break; case !ereg("Before you list again",$thisreport): MailReport("$EMAIL","expired.txt",$thisreport); $REPORTS.="EMAIL SENT:"; break; } $REPORTS .= "$frer[$nn]\n"; $REPORTS_HTML .= "$frer[$nn]"; $nn++; } $MSG="$MESSAGE\n$REPORTS\n\n\n--eWeb Engine, Inc--\nhttp://www.ewebengine.com\n"; mail("bestagent@realtor.com", "Report Inquiry", $MSG,"From: $EMAIL\r\n"."Reply-To: $EMAIL\r\n"); print << Real Estate Reporter Thank you for requesting the following reports/software: $REPORTS_HTML
Thank you for requesting the following reports/software:
$REPORTS_HTML