$t_zipcode = addslashes(trim($zipcode)); $zipcount = strlen($zipcode); if ($isBackedClick == 1) { include $form; } else { $validator->checkField($firstname, "", "Please enter your first name."); $validator->checkField($lastname, "", "Please enter your last name."); $validator->checkField($address1, "", "Please enter your address1."); $validator->checkField($city, "", "Please enter your first city."); $validator->checkField($state, "", "Please select your state."); $validator->checkField($zipcode, "", "Please enter your zip code."); if (!empty($zipcode) && ($zipcount != 5 && $zipcount != 9)) { $validator->setError("Please enter your zip code with 5 or 9 digits."); } $errorMsg = $validator->getErrors(); $dataValid = $validator->isDataValid(); if ($dataValid) { //ADDING IN DATABASE $query = "INSERT INTO users SET firstname='{$firstname}',lastname='{$lastname}',address1='{$address1}',address2='{$address2}',city='{$city}',state='{$state}',zipcode={$zipcode},visitorIP='" . VISITOR_IP_ADDRESS . "',registeredOn='" . CURRENT_DATE_CUSTOMER_ZONE . "',registeredTime='" . CURRENT_TIME_CUSTOMER_ZONE . "'"; mysql_query($query); $_SESSION['success'] = 1; ob_clean(); header("Location: " . SITE_URL); exit; } else { include $form; } } } else { ///////////////////////// SUBMITTING FIRST FORM //////////////// if (isset($_REQUEST['formSubmitted'])) {