Advertisement
Guest User

Untitled

a guest
Apr 7th, 2017
395
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. function AuthMeCheck($username, $password) {
  2. $host = "127.0.0.1";
  3. $id = "root";
  4. $pass = "pass";
  5. $dbn = "authme";
  6. $db = mysqli_connect($host, $id, $pass, $dbn, 3306);
  7. $authmeTable = 'authme';
  8. if($pwd = explode('$', mysqli_fetch_assoc(mysqli_query($db, 'SELECT password FROM '.$authmeTable.' WHERE username="'.$username.'"'))['password']))
  9. if(strcasecmp(trim($pwd['3']), hash('sha256', hash('sha256', $password).$pwd['2'])) == 0)
  10. return 1;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement