Guest User

Untitled

a guest
Jul 3rd, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <?php
  2. include('../inc/header.php');
  3.  
  4. $username = $_POST['username'];
  5. $password = $_POST['password'];
  6. $existscheck = mysql_query("SELECT * FROM users WHERE username = '$username'");
  7.  
  8. if ($_POST['username'] != "")
  9. {
  10. if ($_POST['password'] != "")
  11. {
  12. while($nt=mysql_fetch_array($existscheck)){
  13. if ($nt[password] == md5($password))
  14. {
  15. //SAMPLE LOGIN EVENT
  16. echo "Login Successful";
  17. echo "<br>";
  18.  
  19.  
  20. echo $nt[username];
  21. echo $nt[role];
  22. //END SAMPLE LOGIN EVENT
  23. }
  24. else
  25. {
  26. echo "The username or password is wrong. Redirecting to login form...";
  27. echo "<meta http-equiv=\"Refresh\" content=\"2; url= " . $url ." /login/\">";
  28. exit;
  29. }
  30. }
  31. }
  32. else
  33. {
  34. echo "Please enter a password. Redirecting to login form...";
  35. echo "<meta http-equiv=\"Refresh\" content=\"2; url=<?php echo $url; ?>/login/\">";
  36. exit;
  37. }
  38. }
  39. else
  40. {
  41. echo "Please enter a username. Redirecting to login form...";
  42. echo "<meta http-equiv=\"Refresh\" content=\"2; url=<?php echo $url; ?>/login/\">";
  43. exit;
  44. }
  45. ?>
Add Comment
Please, Sign In to add comment