SHARE
TWEET

Untitled

a guest May 22nd, 2017 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     //=============================================================================//
  2.     // FUNCTION
  3.     // Title:       Login
  4.     // Parameters:  STRING Username, STRING Password
  5.     // Purpose:     Logging in an admin
  6.     // Returns:     BOOL
  7.    
  8.     public function Login((string) $Username,(string) $Password){
  9.        
  10.         var $Encodedpassword = md5($Password);
  11.        
  12.         $Username   = new Sqlparameter($Username);
  13.         $Password   = new Sqlparameter($Encodedpassword);
  14.         $Table      = new Sqlparameter("Users");
  15.        
  16.         $Sql = new Sql ();
  17.         $Sql->Where ('username',$Username);
  18.         $Array = $Sql->SelectSingleRow ($Table,array());
  19.        
  20.         if($Username == $Array['username'] && $Encodedpassword == $Array['password']){
  21.             $_SESSION['Logged'] = true;
  22.             $_SESSION['Userid'] = $Result[0];
  23.             return true;
  24.         }
  25.         else{
  26.             return false;
  27.         }
  28.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top