Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class User
- {
- private $login;
- private $password;
- public function __construct($_POST['login'], $_POST['password'])
- {
- if(!empty($_POST['login']) && !empty($_POST['password'])){
- $this->login = $_POST['login'];
- $this->password = $_POST['password'];
- } else {
- die;
- }
- }
- public function getData()
- {
- var_dump([$this->login, $this->password]);
- }
- }
- $newUser = new User($_POST['login'], $_POST['password']);
- $newUser->getData();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement