}
 if (strlen($password) < ENTRY_PASSWORD_MIN_LENGTH) {
     $error = true;
     $messageStack->add('create_account', ENTRY_PASSWORD_ERROR);
 } elseif ($password != $confirmation) {
     $error = true;
     $messageStack->add('create_account', ENTRY_PASSWORD_ERROR_NOT_MATCHING);
 }
 if ($error == false) {
     $sql_data_array = array('customers_firstname' => $firstname, 'customers_lastname' => $lastname, 'customers_email_address' => $email_address, 'customers_telephone' => $telephone, 'customers_fax' => $fax, 'customers_newsletter' => $newsletter, 'customers_password' => smn_encrypt_password($password));
     if (ACCOUNT_GENDER == 'true') {
         $sql_data_array['customers_gender'] = $gender;
     }
     if (ACCOUNT_DOB == 'true') {
         $dob = $dob_day . '/' . $dob_month . '/' . $dob_year;
         $sql_data_array['customers_dob'] = smn_date_raw($dob);
     }
     smn_db_perform(TABLE_CUSTOMERS, $sql_data_array);
     $customer_id = smn_db_insert_id();
     $sql_data_array = array('customers_id' => $customer_id, 'entry_firstname' => $firstname, 'entry_lastname' => $lastname, 'entry_street_address' => $street_address, 'entry_postcode' => $postcode, 'entry_city' => $city, 'entry_country_id' => $country);
     if (ACCOUNT_GENDER == 'true') {
         $sql_data_array['entry_gender'] = $gender;
     }
     if (ACCOUNT_COMPANY == 'true') {
         $sql_data_array['entry_company'] = $company;
     }
     if (ACCOUNT_STATE == 'true') {
         if ($zone_id > 0) {
             $sql_data_array['entry_zone_id'] = $zone_id;
             $sql_data_array['entry_state'] = '';
         } else {
     }
 }
 if (strlen($a_firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
     $error = true;
     $entry_firstname_error = true;
 } else {
     $entry_firstname_error = false;
 }
 if (strlen($a_lastname) < ENTRY_LAST_NAME_MIN_LENGTH) {
     $error = true;
     $entry_lastname_error = true;
 } else {
     $entry_lastname_error = false;
 }
 if (ACCOUNT_DOB == 'true') {
     if (checkdate(substr(smn_date_raw($a_dob), 4, 2), substr(smn_date_raw($a_dob), 6, 2), substr(smn_date_raw($a_dob), 0, 4))) {
         $entry_date_of_birth_error = false;
     } else {
         $error = true;
         $entry_date_of_birth_error = true;
     }
 }
 if (strlen($a_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH) {
     $error = true;
     $entry_email_address_error = true;
 } else {
     $entry_email_address_error = false;
 }
 if (!smn_validate_email($a_email_address)) {
     $error = true;
     $entry_email_address_check_error = true;