30) || (strlen($password) > 64) || (strlen($gender) > 1) || (strlen($question) > 100)|| (strlen($answer) > 64) || (strlen($address) > 100)) { $_SESSION['error'] = 'One or more input fields are too long.'; header('Location: ?signup'); } else { // Create new User object with variables, initialize data. $user = new User(0, $username, $password, 0, $gender, 0, $question, $answer, $address); if ($user->save('insert')) { // We are making them login so their user object will be updated (user_id, updated, etc.) $_SESSION['notice'] = 'Account created! Please login.'; header('Location: ?login'); } else { $_SESSION['error'] = 'There was a problem making your account. Please try again later.'; header('Location: ?signup'); } } } } } ?>