Advertisement
Guest User

Untitled

a guest
Jul 27th, 2017
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require "dbconn.php";
  4.  
  5. $username = $_POST['username'];
  6. $password = $_POST['password'];
  7. $position = $_POST['position'];
  8.  
  9. $sql = "SELECT * FROM login WHERE username ='".$username."' AND password='".$password."'";
  10.  
  11. $result = mysql_query($sql) or die(mysql_error());
  12.  
  13. $row = mysql_fetch_array( $result );
  14.  
  15. if ($row !=null)
  16. {
  17. $_SESSION['username'] = $row['username'];
  18. if ($position. = Coach)
  19. {
  20. header("Location: coach.php");
  21. exit();
  22. }
  23.  
  24. else
  25. if ($position = Admin)
  26. {
  27. header("Location: king.php");
  28. exit();
  29. }
  30.  
  31. else
  32. if ($position = Player)
  33. {
  34. header("Location: members.php");
  35. exit();
  36. }
  37. }
  38.  
  39. else
  40. {
  41. header("Location: index.php?showerror=1");
  42. exit();
  43. }
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement