Advertisement
Guest User

Untitled

a guest
Jul 8th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2. $username = $_POST['username'];
  3. $password = md5(sha1(md5(md5(sha1($_POST['password'])))));
  4. $userinfo = mysql_query("SELECT * FROM `users` WHERE `username` = '$username'") or die(mysql_error());
  5. $userpass = mysql_query("SELECT * FROM `users` WHERE `password` = '$password'") or die(mysql_error());
  6. $check = mysql_num_rows($userinfo);
  7. $checkpass = mysql_num_rows($userpass);
  8. if($check == '0');
  9. {
  10. echo "Sorry. You have entered the wrong username";
  11. }
  12. if($checkpass =='0');
  13. {
  14. echo "Sorry. You have entered the wrong password";
  15. }
  16. $_SESSION['user'] = "$username";
  17. $_SESSION['password'] = "$password";
  18. echo "You are being logged... Please wait...";
  19. echo "Redirecting you...";
  20.  
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement