Guest User

Untitled

a guest
May 9th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. <?php
  2. session_start();
  3. $user = $_POST["txtUser"];
  4. $pass = $_POST["txtPass"];
  5. include("connect.php");
  6. $rs = mysql_query("SELECT username, password, catId FROM member WHERE username='$user' and password = '".md5($pass)."'" );
  7. while($row = mysql_fetch_assoc($rs))
  8. {
  9. $usernamedb = $row['username'];
  10. $key = $row['password'];
  11. $catiddb = $row['catId'];
  12. }
  13. if($user == "" || $pass == "")
  14. {
  15. header("location:index.php?page=login&err=Username or Password is not filled");
  16. }
  17. if($usernamedb == "")
  18. {
  19. header("location:index.php?page=login&err=Username is not registered");
  20. }
  21. if($usernamedb == $user && $key != md5($pass))
  22. {
  23. header("location:index.php?page=login&err=Password is wrong");
  24. }
  25. if($usernamedb == $user && $key == md5($pass))
  26. {
  27. $_SESSION["USER"] = $usernamedb;
  28. $_SESSION["ID"] = $catiddb;
  29. header("location:controlpanel.php");
  30. }
  31. ?>
Add Comment
Please, Sign In to add comment