Advertisement
Guest User

Untitled

a guest
May 13th, 2017
154
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. public function check_pswd($username,$password)
  3. {
  4.     $password = md5($password);
  5.     $query = 'SELECT * FROM users WHERE username=\''.$username.'\'';
  6.     if ($check = mysql_query($query))
  7.     {
  8.         if (mysql_num_rows($check)!=0)
  9.         {
  10.             $info = mysql_fetch_array($check);
  11.             $sql_pswd = $info['password'];
  12.    
  13.             if($password != $sql_pswd)
  14.             {
  15.                 return FALSE;
  16.             }
  17.             else
  18.             {
  19.                 return TRUE;
  20.             }
  21.         }
  22.         else
  23.         {
  24.             return FALSE;
  25.         }
  26.     }
  27.     else
  28.     {
  29.         return FALSE;
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement