Guest User

Untitled

a guest
Oct 20th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  1.  function registerAccount($userName, $password, $email, $expansion /*, $recruiter */)
  2.     {
  3.         $passwordHash = strtoupper(sha1(strtoupper($username) . ':' . strtoupper($password)));
  4.         $account = new Account($userName, $passwordHash, $email, $expansion);
  5.         $mysqlConn = new mysqli($mysqlHost, $mysqlUser, $mysqlPassword, $accountDb);
  6.        
  7.         if(!$mysqlConn->query("INSERT INTO account (username, sha_pass_hash, email, expansion)
  8.                           VALUES ('" . $account->userName . "', '" . $account->passwordHash . "',"
  9.                            . "'" . $account->email . "', " . $account->expansion))
  10.         {
  11.             return FALSE;
  12.         }
  13.        
  14.         $mysqlConn->close();
  15.        
  16.         return $account;
  17.     }
Add Comment
Please, Sign In to add comment