Invalid input."; include $incpath."signup.php"; exit(); } clean_vars($_POST); $user = $_POST["user"]; $pass1 = $_POST["pass1"]; $pass2 = $_POST["pass2"]; $company = $_POST["company"]; $email = $_POST["email"]; $address = $_POST["address"]; $town = $_POST["town"]; $state = $_POST["state"]; $phone = $_POST["phone"]; //$vehmembertype = $_POST["vehmembertype"]; //$equmembertype = $_POST["equmembertype"]; $webaddress = (strtoupper($_POST["webaddress"]) == "N/A") ? "" : $_POST["webaddress"]; $name = $_POST["name"]; $zipcode = $_POST["zipcode"]; $repID = $_POST["repID"]; $repName = $_POST["repName"]; if (strlen($name) > 30) { $errormsg = "Incorrect contact name size."; include $incpath."signup.php"; exit(); } if (strlen($user) < 4 || strlen($user) > 15 ) { $errormsg = "Incorrect username size."; include $incpath."signup.php"; exit(); } if (strstr($user," ")) { $errormsg = "Username cannot contain whitespace."; include $incpath."signup.php"; exit(); } if (strlen($pass1) < 5 || strlen($pass1) > 12 || strlen($pass2) < 5 || strlen($pass2) > 12) { $errormsg = "Incorrect password size."; include $incpath."signup.php"; exit(); } $sql = "SELECT username FROM users WHERE username='$user' LIMIT 1"; connect_DB(); $res = mysql_db_query($MDTMainDB,$sql,$conn); if (mysql_num_rows($res) > 0) { $errormsg = "That username is already in use."; mysql_close(); include $incpath."signup.php"; exit(); } mysql_close(); if ($pass1 != $pass2) { $errormsg = "Passwords do not match."; $pass1 = ""; $pass2 = ""; include $incpath."signup.php"; exit(); } $pattern = "/^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}/"; if (!preg_match($pattern, $email)) { $errormsg = "Invalid email address."; include $incpath."signup.php"; exit(); } $phone = str_replace(" ","",$phone); $phone = str_replace("-","",$phone); //$pattern = "/^[0-9]+$/"; if (strlen($phone) != 10) { $errormsg = "Invalid phone number."; include $incpath."signup.php"; exit(); } if (!is_numeric($phone)) { $errormsg = "Phone number can only contain numbers."; include $incpath."signup.php"; exit(); } if (!is_numeric($zipcode) || strlen($zipcode) != 5) { $errormsg = "Invalid zip code."; include $incpath."signup.php"; exit(); } $today = date('Y-m-d'); $expireveh = "0000-00-00"; $expireacc = "0000-00-00"; /* if ($equmembertype == 0 && $vehmembertype == 0) { $errormsg = "You must pick a membership type."; include $incpath."signup.php"; exit(); } else if ($equmembertype == 0 && $vehmembertype == 1) { $membertype = 2; $vehperiod = 12; $expireveh = date('Y-m-d',mktime(0, 0, 0, date("m")+6 , date("d"), date("Y"))); } else if ($equmembertype == 0 && $vehmembertype == 2) { $membertype = 2; $vehperiod = 6; $expireveh = date('Y-m-d',mktime(0, 0, 0, date("m")+6 , date("d"), date("Y"))); } else if ($equmembertype == 1 && $vehmembertype == 0) { $membertype = 1; $accperiod = 12; $expireacc = date('Y-m-d',mktime(0, 0, 0, date("m")+6 , date("d"), date("Y"))); } else if ($equmembertype == 1 && $vehmembertype == 1) { $membertype = 3; $vehperiod = 12; $accperiod = 12; $expireveh = date('Y-m-d',mktime(0, 0, 0, date("m")+6 , date("d"), date("Y"))); $expireacc = date('Y-m-d',mktime(0, 0, 0, date("m")+6 , date("d"), date("Y"))); } else if ($equmembertype == 1 && $vehmembertype == 2) { $membertype = 3; $vehperiod = 6; $accperiod = 12; $expireveh = date('Y-m-d',mktime(0, 0, 0, date("m")+6 , date("d"), date("Y"))); $expireacc = date('Y-m-d',mktime(0, 0, 0, date("m")+6 , date("d"), date("Y"))); } */ $membertype = 3; $vehperiod = 12; $accperiod = 12; $expireveh = date('Y-m-d',mktime(0, 0, 0, date("m")+1 , date("d"), date("Y"))); $expireacc = date('Y-m-d',mktime(0, 0, 0, date("m")+1 , date("d"), date("Y"))); connect_DB(); $sql = "INSERT INTO users SET username = '$user', userpassword = SHA1('$pass1'), companyname = '$company', email = '$email', address = '$address', town = '$town', state = '$state', zipcode = '$zipcode', phone = '$phone', membertype = '$membertype', lastlogindate = '$today', signupdate = '$today', expiredateveh = '$expireveh', expiredateacc = '$expireacc', vehperiod = '$vehperiod', accperiod = '$accperiod', webaddress='$webaddress', name='$name', active='0', repName='$repName', repID='$repID'"; //added expireveh=??,expireacc=??,active = membertype for free 6 months $res = mysql_db_query($MDTMainDB,$sql,$conn); if (mysql_error() != "") { $errormsg = "
Error updating database. Please try again later. ".mysql_error()."
"; } $emailmsg = "Thank you for signing up for an account with MDTMotors.com!\n\nYou have 24 hours to pay for your subscription(s). If payment is not received within 24 hours, your account will be removed and you will be required to sign up again. Once payment is received, your account will be activated and you will be allowed to post.\n\nTo pay and activate your account, please visit http://www.mdtmotors.com/pay/pay.php. You will be required to sign in using the username and password you provided. Then simply click the PayPal Subscribe button, and continue the process on the PayPal website.\r\n\r\nAnd don't forget! As a member, you now have access to the \"Wanted Ad Section,\" where you can see what some existing customers are looking for (as well as their contact information)!\r\n\r\nThank you again and welcome to the MDTMotors.com Community!\n\nMDTMotors.com Support Team\nsupport@mdtmotors.com"; //$emailmsg = "Thank you for signing up for an account with MDTMotors.com!\r\n\r\nAs a sign of gratitude for your willingness to try our growing website, we are giving you a FREE six months. At the conclusion of the six months, you will be required to make payments to continue your MDTMotors.com membership. If you decide you do not want to continue the membership, you can simply cancel your subscription at any time by accessing the \"Control Panel\" page.\r\n\r\nYou can begin posting your inventory right away! Simply log in using the credentials you signed up with, and you are immediately on your way to increasing revenue through internet advertising!\r\n\r\nAnd don't forget! As a member, you now have access to the \"Wanted Ad Section,\" where you can see what some existing customers are looking for (as well as their contact information)!\r\n\r\nThank you again and welcome to the MDTMotors.com Community!\n\nMDTMotors.com Support Team\nsupport@mdtmotors.com"; $headers = 'From: MDTMotors Support Team ' . "\r\n" . 'Reply-To: support@mdtmotors.com'; @mail($email,"MDTMotors.com - Account Payment",$emailmsg,$headers); //@mail($email,"MDTMotors.com - Account Creation Successful!",$emailmsg,$headers); $succmsg = "Account created successfully. An email has been sent to the address you specified, which will show you how to pay for and activate your account."; $joelmsg = "There has been a new account created on MDTMotors.com.\n\n"."Username: ".$user."\nEmail: ".$email."\nPhone: ".$phone."\nReferring Sales Rep Name: ".$repName."\nReferring Sales Rep ID: ".$repID."\n\nEnd Transmission"; @mail("jdavis@mdtmotors.com","MDTMotors.com - New Account Notification",$joelmsg,$headers); $sql = "INSERT INTO referrals(username,repid,date,vehperiod,accperiod) VALUES('$user','$repID',CURRENT_DATE(),'$vehperiod','$accperiod')"; $res = mysql_db_query($MDTMainDB,$sql,$conn); if (mysql_error() != "") { $errormsg = "
Error updating database. Please try again later. ".mysql_error()."
"; } mysql_close(); //header("Location: http://www.mdtmotors.com/pay/pay.php"); //exit(); } ?> MDTMotors.com | New Account Registration

Sign Up For a New Account ".$errormsg."

"; unset($errormsg); } else if (isset($succmsg)) { $user = ""; $pass1 = ""; $pass2 = ""; $company = ""; $email = ""; $address = ""; $country = ""; $town = ""; $state = ""; $phone = ""; $membertype = ""; $webaddress = ""; $name = ""; $repID = ""; $repName = ""; $zipcode = ""; echo "
".$succmsg."

"; } ?>
Every field is required. If website address does not apply, enter "N/A".

Please keep in mind that most of this information is to be used on your posts. Make sure it is accurate.

4 - 15 characters
5 - 12 characters








ex. 12345
ex. 555-555-1234



Please only fill out the following boxes if you were referred to MDTMotors.com™ by a Sales Representative.




Note: By clicking "Register" you are agreeing to the Terms of Service.