set_username($_POST['username']); $obj_user->set_email($_POST['email']); $ret = $obj_user->register_user(); switch ( $ret ) { case REGISTER_INVALID_USERNAME: $msg = "Invalid username"; break; case REGISTER_INVALID_EMAIL: $msg = "Invalid email address"; break; case REGISTER_USER_EXISTS: $msg = "User already exists"; break; case REGISTER_EMAIL_EXISTS: $msg = "Email already taken."; break; case REGISTER_SUCCESS: $msg = "Account created"; include('index.php'); return; break; } } ?>