Advertisement
Guest User

Untitled

a guest
May 16th, 2017
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?
  2. require "connect_db.php";
  3. $username = addslashes($_POST['username']);
  4. $password = addslashes($_POST['password']);
  5.  
  6.  
  7. $sql = "SELECT * FROM jos_users WHERE username='$username'";
  8. $temp = mysql_fetch_array(mysql_query($sql));
  9.  
  10.  
  11. $remote_pass = $temp['password'];
  12. $parts = explode( ':', $remote_pass );
  13. if (count($parts) < 2) $converted_pass = md5($password);
  14. else {
  15.  $salt = $parts[1];
  16.  $converted_pass = md5($password . $salt) . ":" . $salt;
  17. }
  18.  
  19. if ( $converted_pass == $remote_pass )
  20. {
  21.  echo "JEST!";
  22. }
  23. else
  24. {
  25.  echo "NIJE!";
  26. }
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement