Name!"; $missing_email = "You did not enter a valid E-mail Address!"; $missing_address = "You did not enter your Street Address!"; $missing_city = "You did not enter your City!"; $missing_state = "You did not enter your State!"; $missing_zip = "You did not enter your Zip Code!"; $missing_phonehome = "You did not enter your Home Phone Number!"; $missing_prev_address = "You did not enter your Previous Street Address!"; $missing_prev_city = "You did not enter your Previous City!"; $missing_prev_state = "You did not enter your Previous State!"; $missing_prev_zip = "You did not enter your Previous Zip Code!"; $missing_ssn = "You did not enter your Social Security Number!"; $missing_date_of_birth = "You did not enter a valid Date of Birth!"; $missing_agreement = "You must agree to the terms of the ADT Pre-Approval form!"; $thanks = "Thanks, ".$_POST['name'].".

\nYour ADT Pre-Approval Form has been submitted successfully. One of our representatives will be in touch with you soon. Thanks again!"; $subject = "ADT Pre-Approval Form Submission"; $content = "Hello, ".$_POST['name']." has submitted an ADT Pre-Approval Form. Click here to login to the administrative area: ".$preapprovalAdmin." Regards, The Management"; // FUNCTIONS function getSqlRow($query) { $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_array($result); mysql_free_result($result); return $row; } function getSqlNumber($sqlQuery) { $query=mysql_query($sqlQuery); $result=mysql_num_rows($query); mysql_free_result($query); return $result; } function messageTable($message) { echo "
$message
"; exit; } function check_referer($referers) { if (count($referers)) { $found = false; $temp = explode("/",getenv("HTTP_REFERER")); $referer = $temp[2]; for ($x=0; $x < count($referers); $x++) { if (eregi ($referers[$x], $referer)) { $found = true; } } if (!getenv("HTTP_REFERER")) $found = false; if (!$found){ messageTable("You are coming from an unauthorized domain."); } return $found; } else { return true; // not a good idea, if empty, it will allow it. } } ?> :: Secure America :: 513.271.5500 ::


You have entered an incorrect password. Please try again.
"; } ?>
To access the ADT Pre-Approval form you need the proper password from your Secure America representative. If you do not have a password, please click here to contact us.
Password:
"; if ($_POST['name'] == '') { echo $missing_name; echo "
\n"; } if (($_POST['email'] == '') || (!eregi("^[_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3}$", $_POST['email']))) { echo $missing_email; echo "
\n"; } if ($_POST['address'] == '') { echo $missing_address; echo "
\n"; } if ($_POST['city'] == '') { echo $missing_city; echo "
\n"; } if ($_POST['state'] == '') { echo $missing_state; echo "
\n"; } if ($_POST['zip'] == '') { echo $missing_zip; echo "
\n"; } if ($_POST['phonehome'] == '') { echo $missing_phonehome; echo "
\n"; } if ($_POST['no_prev_address'] == '' || !$_POST['no_prev_address']) { if ($_POST['prev_address'] == '') { echo $missing_prev_address; echo "
\n"; } if ($_POST['prev_city'] == '') { echo $missing_prev_city; echo "
\n"; } if ($_POST['prev_state'] == '') { echo $missing_prev_state; echo "
\n"; } if ($_POST['prev_zip'] == '') { echo $missing_prev_zip; echo "
\n"; } } if ($_POST['ssn'] == '') { echo $missing_ssn; echo "
\n"; } if ($_POST['birth_month'] == '' || $_POST['birth_day'] == '' || $_POST['birth_year'] == '') { echo $missing_date_of_birth; echo "
\n"; } if ($_POST['agreement'] == '') { echo $missing_agreement; echo "
\n"; } echo "
"; echo "
\n"; include_once ("preapprovalform.php"); //SUBMIT DATA, SEND AN EMAIL, SAY THANKS } else { $insertPreApproval = mysql_query("INSERT INTO preapproval_submissions (name,email,address,city,state,zip,phonehome,phonework,phonecel,prev_address,prev_city,prev_state,prev_zip,submitdate,recipient,q_1,q_2,q_3,q_4,q_5,q_6,ssn,date_of_birth,agreement) VALUES ( '".$_POST['name']."','".$_POST['email']."','".$_POST['address']."','".$_POST['city']."','".$_POST['state']."','".$_POST['zip']."','".$_POST['phonehome']."','".$_POST['phonework']."','".$_POST['phonecel']."','".(($_POST['prev_address'] == "")?"N/A":$_POST['prev_address'])."','".(($_POST['prev_city'] == "")?"N/A":$_POST['prev_city'])."','".(($_POST['prev_state'] == "")?"N/A":$_POST['prev_state'])."','".(($_POST['prev_zip'] == "")?"N/A":$_POST['prev_zip'])."','".time()."','".$_POST['recipient']."','".$_POST['q_1']."','".$_POST['q_2']."','".$_POST['q_3']."','".$_POST['q_4']."','".$_POST['q_5']."','".$_POST['q_6']."','".$_POST['ssn']."','".$_POST['birth_month']."-".$_POST['birth_day']."-".$_POST['birth_year']."','".$_POST['agreement']."')"); if ($_POST['recipient'] != "") { $userEmail = getSqlRow("SELECT * FROM surveys_users WHERE display=1 AND id=".$_POST['recipient'].""); $recipientEmail = $userEmail['email']; } else { $recipientEmail = "info@secureamericainc.com"; } mail($recipientEmail, $subject, $content, "From: $fromemail\r\nReply-To: $email\r\nX-Mailer: DT_formmail"); messageTable($thanks); } #################################### ### SHOW THE FORM #################################### } else { include_once ("preapprovalform.php"); } ?>