daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Jan 23rd, 2018 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function registerUser() {
  2.         global $errorMessage;
  3.        
  4.         $firstName = $_POST['inputFirstName'];
  5.         $lastName = $_POST['inputLastName'];
  6.         $username = $_POST['inputEmail'];
  7.         $password = $_POST['inputPassword'];
  8.         $pwConfirm = $_POST['inputPasswordConfirm'];
  9.        
  10.         if (!Account::isUsernameAvailable($username)) {
  11.             $errorMessage .= "There is already an account associate with ";
  12.             $errorMessage .= " that e-mail address. Try <a href=\"index.php\">logging in</a> instead.<br>";
  13.         }
  14.        
  15.         if ($password != $pwConfirm) {
  16.             $errorMessage .= "The password and confirmation password do not match.<br>";
  17.         }
  18.        
  19.         if ($errorMessage != null) { return; }
  20.        
  21.         $account = new Account($firstName, $lastName, $username, $password);
  22.         Account::add($add);
  23.        
  24.         header('Location: index.php?action=registered');
  25.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top