Advertisement
Guest User

Untitled

a guest
Jun 18th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.51 KB | None | 0 0
  1. //indsat i config.php
  2.  
  3. $login = new Authorize('', '');
  4. $login->auth();
  5.  
  6.  
  7.  
  8. //authorize.class.php
  9.  
  10. <?
  11. class Authorize {
  12.  
  13.     private $username;
  14.     private $password;
  15.    
  16.     public function Authorize($username, $password) {
  17.         $this->username = $username;
  18.         $this->password = $password;
  19.     }
  20.    
  21.     public function auth() {
  22.         $result = mysql_query("SELECT * FROM admin_users WHERE username='$this->username' AND password='$this->password'");
  23.         if (!$result) {
  24.             die('Fejl i Query'.mysql_error());
  25.         }
  26.     }
  27.  
  28. }
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement