‘phone’, ‘WorkPhone’=>’phone’, ’email’=>’email’, ‘EmploymentYears’=>’digit’, ‘EmploymentMonths’=>’digit’,
);
// convert required array into validators
foreach ($required as $field) {
if (!array_key_exists($field, $validators)) {
$validators[$field] = array();
}
if (!is_array($validators[$field])) {
$validators[$field] = array($validators[$field]);
}
$validators[$field][] = ‘required’;
}

function not_empty($val=”) {
return trim($val) != ”;
}

function is_phone($val=”) {
// remove non-numbers
$val = str_replace(array(‘(‘, ‘)’, ‘-‘, ‘ ‘), ”, $val);
if (in_array(substr($val, 0, 1), array(‘0’, ‘1’)) or strlen($val) < 10) { return false; } return is_numeric($val); } function browser_info($agent=null) { // Declare known browsers to look for $known = array('msie', 'firefox', 'safari', 'webkit', 'opera', 'netscape', 'konqueror', 'gecko'); // Clean up agent and build regex that matches phrases for known browsers // (e.g. "Firefox/2.0" or "MSIE 6.0" (This only matches the major and minor // version numbers. E.g. "2.0.0.6" is parsed as simply "2.0" $agent = strtolower($agent ? $agent : $_SERVER['HTTP_USER_AGENT']); $pattern = '#(?‘ . join(‘|’, $known) .
‘)[/ ]+(?[0-9]+(?:\.[0-9]+)?)#’;

// Find all phrases (or return empty array if none found)
if (!preg_match_all($pattern, $agent, $matches)) return array();

// Since some UAs have more than one phrase (e.g Firefox has a Gecko phrase,
// Opera 7,8 have a MSIE phrase), use the last one found (the right-most one
// in the UA). That’s usually the most correct.
$i = count($matches[‘browser’])-1;
return $matches[‘browser’][$i] .’ ‘. $matches[‘version’][$i];
}

$validate_functions = array(
‘digit’=>’is_numeric’, ’email’=>’is_email’, ‘required’=>’not_empty’, ‘phone’=>’is_phone’,
);
$validation_messages = array(
‘digit’=>’This value must contain only numbers.’,
’email’=>’This is not a valid email address.’,
‘required’=>’This field is required.’,
‘phone’=>’This is not a valid phone number (nnn-nnn-nnnn).’,
);

$validation_errors = array();
foreach ($validators as $field=>$funcs) {
if (!isset($_REQUEST[$field])) {
$validation_errors[$field] = $validation_messages[‘required’];
continue;
}
foreach ($funcs as $func) {
if (array_key_exists($func, $validate_functions)) {
$ret = call_user_func($validate_functions[$func], $_REQUEST[$field]);
if (false === $ret) {
$validation_errors[$field] = $validation_messages[$func];
}
}
}
}

// a few country-specific validators
if (!isset($_POST[‘country’]) || $_POST[‘country’] == ‘usa’) {
if (!isset($_POST[‘ssn’]) || !is_numeric(trim($_POST[‘ssn’])) || strlen(trim($_POST[‘ssn’])) != 9) {
$validation_errors[‘ssn’] = ‘SSN must be present, and 9 digits long.’;
}
if (!isset($_POST[‘zip’]) || !is_numeric(trim($_POST[‘zip’])) || strlen(trim($_POST[‘zip’])) != 5) {
$validation_errors[‘zip’] = ‘Zip Code must be present, and 5 digits long.’;
}
} else {
if (!isset($_POST[‘zip’])
|| !preg_match(‘/^[ABCEGHJ-NPRSTVXY]{1}[0-9]{1}[ABCEGHJ-NPRSTV-Z]{1}[ ]?[0-9]{1}[ABCEGHJ-NPRSTV-Z]{1}[0-9]{1}$/’, strtoupper($_POST[‘zip’]))) {
$validation_errors[‘zip’] = ‘Postal Code must be present, and valid.’;
}
}

if(empty($validation_errors) and isset($_REQUEST[‘iphorm_id’]) && $_REQUEST[‘iphorm_id’] == 6) {
$CREDITREPORTAUTHORIZATION = ‘true’;
$THIRDPARTYAUTHORIZATION = ‘true’;
$BANKRUPTCYFLAG = ‘false’;
$EMPLOYMENT = ‘current’; //(empty($_REQUEST[‘EmploymentType’])) ? ” : ‘current’;
$PRIVACYSTATEMENTCHECKED = ”;
if(isset($_REQUEST[‘PrivacyStatementChecked’]) && $_REQUEST[‘PrivacyStatementChecked’][0]==true) {
$PRIVACYSTATEMENTCHECKED = ‘true’;
}
$TCPA_Checked = ”;
if (isset($_POST[‘ExpNotificationChecked’]) && strtolower($_POST[‘ExpNotificationChecked’]) == ‘on’) {
$TCPA_Checked = ‘true’;
}
$options = array(‘ref’=>urlencode($_SERVER[‘SERVER_NAME’]), ‘source’=>’10305’);
if (array_key_exists(‘source_id’, $_COOKIE)) {
$options[‘source’] = $_COOKIE[‘source_id’];
}
if (array_key_exists(‘ref’, $_COOKIE)) {
$options[‘ref’] = $_COOKIE[‘ref’];
}
foreach ($options as $key=>$val) {
if (!empty($_REQUEST[$key]) and ”!=trim($_REQUEST[$key])) {
$options[$key] = urlencode(trim($_REQUEST[$key]));
}
}

if (!empty($options[‘ref’])) {
$options[‘ref’] .= ‘|Mobile-‘;
}
$options[‘ref’] .= browser_info();
if (empty($options[‘ref’])) {
// substr doesn’t like strings without characters in them
$options[‘ref’] = ‘ ‘;
}
$url = ‘https://affiliate.autoloanoptions.com/affiliateUS/post?AffiliateReferenceNumber=’ . urlencode(substr($options[‘ref’], 0, 256))
. ‘&sourceid=’ . $options[‘source’]
. ‘&ssn=’. urlencode($_REQUEST[‘ssn’])
. ‘&zip=’ . urlencode($_REQUEST[‘zip’])
. ‘&zip4=&gmi=’ . urlencode($_REQUEST[‘MonthlyIncome’])
. ‘&ResidenceYears=1’
. ‘&ResidenceMonths=1’
. ‘&ResidenceAmount=’ . urlencode($_REQUEST[‘ResidenceAmount’])
. ‘&PingID=&address2=&PrivacyStatementChecked=’ . $PRIVACYSTATEMENTCHECKED
. ‘&NameFirst=’ . urlencode($_REQUEST[‘NameFirst’])
. ‘&NameLast=’ . urlencode($_REQUEST[‘NameLast’])
. ‘&DOB=’ . urlencode(date(‘m/d/Y’, strtotime($_REQUEST[‘DOB’])))
. ‘&Phone1=’ . urlencode($_REQUEST[‘Phone1’])
. ‘&Phone2=’ . urlencode($_REQUEST[‘WorkPhone’])
. ‘&Phone3=&CreditReportAuthorization=’
. $CREDITREPORTAUTHORIZATION
. ‘&ThirdPartyAuthorization=’ . $THIRDPARTYAUTHORIZATION
. ‘&PrivacyStatementChecked=’ . $PRIVACYSTATEMENTCHECKED
. ‘&ExpNotificationChecked=’ . $TCPA_Checked
. ‘&FICOScore=400&SelfCreditEval=’ . urlencode($_REQUEST[‘CREDITEVAL’])
. ‘&email=’ . urlencode($_REQUEST[’email’])
. ‘&address1=’ . urlencode($_REQUEST[‘address1’])
. ‘&address2=’ . urlencode($_REQUEST[‘address2’])
. ‘&EmploymentMonths=’ . urlencode($_REQUEST[‘EmploymentMonths’])
. ‘&EmploymentYears=’ . urlencode($_REQUEST[‘EmploymentYears’])
. ‘&JobTitle=’ . urlencode($_REQUEST[‘JobTitle’])
. ‘&EmployerName=’ . urlencode($_REQUEST[‘EmployerName’])
. ‘&EmploymentType=’ . $EMPLOYMENT
. ‘&BankruptcyFlag=’ . $BANKRUPTCYFLAG
. ‘&ipAddress=’ . urlencode($_SERVER[‘REMOTE_ADDR’]);

//echo ‘

'; var_dump($url); echo '

‘;
$ctx = stream_context_create(array(‘http’=>
array(
‘timeout’ => 200, // 1 200 Seconds = 20 Minutes
)
));

$xml = file_get_contents($url, false, $ctx);
//echo ‘

'; var_dump($xml); echo '

‘;
$xml = simplexml_load_string(str_ireplace(‘:string’, ”, $xml));
//echo ‘

'; var_dump($xml); echo '

‘;
$message = ‘Thanks for your interest, there was an issue with your information.
Please call 855 521 5626 for further assistance.’;
if (!empty($xml) and !empty($xml->Rejectedreason) and ‘Duplicate’==$xml->Rejectedreason) {
$message = ‘Thanks for your interest, we already have your information.
Please call 855 521 5626 for further assistance.’;
} else if (!empty($xml->RejectedErrors) and !empty($xml->RejectedErrors->a)) {
$responses = array();
foreach ($xml->RejectedErrors->a as $ndx=>$error) {
$error = (string)$error;
if (!empty($error)) {
$responses[] = str_replace(array(‘Phone1’, ‘Phone2’), array(‘Home Phone’, ‘Work Phone’), trim($error));
}
}
$responses = array_unique(array_filter($responses));
if (!empty($responses)) {
$message = implode(‘
‘, $responses);
}
}
/*if(empty($xml)
or ($xml->Success == “false”
and (empty($xml->LeadID) or 1>=strlen($xml->LeadID))
)
) {
$display_message = ‘

‘ . $message . ‘

‘;
} else {*/
$page = ‘/thank-you-2’;
if (!array_key_exists(‘source_id’, $_COOKIE)) {
$page = ‘/thank-you-3’;
}
$phone = preg_replace(‘/\D/’, ”, $_REQUEST[‘Phone1’]);
$page = $page . ‘/?fname=’ . urlencode($_REQUEST[‘NameFirst’])
. ‘&lname=’ . urlencode($_REQUEST[‘NameLast’])
. ‘&pp1=’ . urlencode(substr($phone, 0, 3))
. ‘&pp2=’ . urlencode(substr($phone, 3, 3))
. ‘&pp3=’ . urlencode(substr($phone, 6, 4))
. ‘&email=’ . urlencode($_REQUEST[’email’])
. ‘&straddr=’ . urlencode($_REQUEST[‘address1’])
. ‘&city=&state=&zip=’ . urlencode($_REQUEST[‘zip’]);
wp_redirect($page);
exit;
//}
} elseif (!empty($validation_errors) and isset($_REQUEST[‘iphorm_id’]) && $_REQUEST[‘iphorm_id’] == 6) {
$display_message = ‘

There were some invalid fields. Please check the form for details about the specific errors.

‘;
}

// adds the submitted value of the field
function field($name=”, $title=”, $type=”, $options=array()) {
$value = $tail = ”;
$class = ‘vtip’;
if (isset($_REQUEST[$name])) {
$value = htmlentities($_REQUEST[$name]);
if (empty($type)) {
$value = ‘value=”‘ . $value . ‘”‘;
} else if (‘check’ == $type) {
$checked = empty($value) ? ‘checked’ : ”;
$value = ‘checked=”‘ . $checked . ‘”‘;
}
}
if (‘select’==$type and !empty($options)) {
$tail = ‘>’;
$value = strtolower(trim($value));
foreach ($options as $key=>$val) {
$selected = (strval($key)===$value) ? ‘ selected=”selected” ‘ : ”;
$tail .= ‘‘;
}
// no vtip (class) for selects, it breaks for IE
$value = ”;
$class = ”;
} else if (‘radio’==$type and !empty($options)) {
$tail = array();
foreach ($options as $val) {
$checked = ($val===$value) ? ‘ checked=”checked”‘ : ”;
$tail[] = ‘‘;
}
return implode(‘
‘, $tail); // radios are special
}
// class is only added if there’s a title
if (!empty($title)) {
$title = ‘title=”‘ . $title . ‘” class=”short ‘.$class.'” ‘;
}
return $title.’id=”‘.$name.'” name=”‘.$name.'” ‘.$value.$tail;
}

function field_errors($name=”, $errors=array()) {
return ”;
if (!empty($_REQUEST) and array_key_exists($name, $errors)) {
return ‘

‘ . $errors[$name] . ‘

‘;
}
return ”;
}

if (!empty($_GET[‘status’]) and $_GET[‘status’] == ‘success’) {
$display_message = ‘

Application Successful

‘;
}

$common_header = ‘

‘;

$common_footer = ‘

‘;
?>

Next


Next


Next


Next



Personal Information

Next

First Name

/>

Last Name

/>

Email Address

/>

Phone Number

/>

Social Security # (Numbers Only)

/>

Date of Birth – Month

Date of Birth – Day

Date of Birth – Year

Next

Back

Residential Information

Next

Street Address

/>

Street Address 2

/>

Zip Code

/>

Housing Payment

Next

Back

Employment Information

Next

Name Of Employer

/>

Job Title

/>

Monthly Income (Pre-Tax)

Other Income

Work Phone

/>

Years At Job

Months At Job

Next

Back

Apply

Apply

Click Here to read privacy notice, terms and conditions, and state-specific notices, and consent to receive Electronic Documents.

By clicking “APPLY” I certify that all statements in this application are true and complete, and are made for the purpose of obtaining credit. I authorize BadCreditCarLoansNow.com and its lender platform and /or dealer network to check my credit, and/or forward my application to other lenders for consideration. I understand that BadCreditCarLoansNow.com, and its third party associates may contact me with updates on my application, and relevant offers at the email address, and ANY of the numbers I provided (including a mobile device, via voice, SMS, MMS etc.) I also understand that these communications may be delivered to me utilizing an automatic dialing system, and this authorization removes any previous registration(s) on a federal/state Do-Not-Call (DNC) registry or internal BadCreditCarLoansNow.com opt-out/unsubscribe requests. Lastly I understand that although this consent could provide me with most accelerated updates, that it is not a condition of service. To submit an application without consent to these expedited notification methods click here