Advertisement
Guest User

Untitled

a guest
Oct 6th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. <?php
  2.  
  3. class User
  4. {
  5.     private $login;
  6.     private $password;
  7.  
  8.     public function __construct($_POST['login'], $_POST['password'])
  9.     {
  10.         if(!empty($_POST['login']) && !empty($_POST['password'])){
  11.  
  12.             $this->login = $_POST['login'];
  13.             $this->password = $_POST['password'];
  14.  
  15.         } else {
  16.            
  17.             die;
  18.         }
  19.     }
  20.  
  21.     public function getData()
  22.     {
  23.         var_dump([$this->login, $this->password]);
  24.     }
  25.        
  26. }
  27.  
  28. $newUser = new User($_POST['login'], $_POST['password']);
  29.  
  30. $newUser->getData();
  31. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement