Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class userAuth {
- public $username;
- private $password;
- private $_resultCode;
- public function _construct($username,$password) {
- $this->username = $username;
- $this->password = $password;
- $this->_resultCode = -1;
- }
- public function getResultCode() {
- return $this->_resultCode;
- }
- public function authenticateUser() {
- if($this->username == "billy") {
- $this->_resultCode = 1;
- if ($this->password == "test") $this->_resultCode = 2;
- } else $this->_resultCode = -1;
- }
- }
- ?>
- <?php
- $user_auth = new userAuth("test", "123");
- echo $user_auth->username;
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement