Advertisement
Stratician

Super Clean Signup

Feb 3rd, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. class Signup {
  2.    
  3.     protected $username;
  4.     protected $email;
  5.     protected $password;
  6.  
  7.     public function __construct($username, $email, $password)
  8.     {
  9.         $this->username = $username;
  10.         $this->email = $email;
  11.         $this->hashPass($password);
  12.     }
  13.  
  14.     protected function hashPass($hashedPass)
  15.     {
  16.         $this->password = password_hash($hashedPass, PASSWORD_DEFAULT);
  17.     }
  18. }
  19.  
  20. $newSignup = new Signup($_POST['username'], $_POST['email'], $_POST['password']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement