Created
June 4, 2018 22:24
-
-
Save waltertschwe/26dd65fc6d4e1ef534dd3c6f6d53aed4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class Registration | |
| { | |
| function __construct($user, $password) { | |
| $this->user = $user; | |
| // salt should be stored in .env file | |
| $this->password = crypt($password, '$2a$09$tdfndZfdksdddf$'); | |
| } | |
| function registerUser() { | |
| // stubbed save function that would talk to your data storage ( mysql, mongodb, etc) | |
| $this->save($this->user, $this->password); | |
| } | |
| } | |
| (isset($_POST['user'])) ? $user = $_POST['user'] : $user = "[email protected]"; | |
| (isset($_POST['pass'])) ? $password = $_POST['password'] : $password = "%ZZprxt5"; | |
| $register = new Registration($user, $password); | |
| $register->registerUser(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment