Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require "dbconn.php";
- $username = $_POST['username'];
- $password = $_POST['password'];
- $position = $_POST['position'];
- $sql = "SELECT * FROM login WHERE username ='".$username."' AND password='".$password."'";
- $result = mysql_query($sql) or die(mysql_error());
- $row = mysql_fetch_array( $result );
- if ($row !=null)
- {
- $_SESSION['username'] = $row['username'];
- if ($position. = Coach)
- {
- header("Location: coach.php");
- exit();
- }
- else
- if ($position = Admin)
- {
- header("Location: king.php");
- exit();
- }
- else
- if ($position = Player)
- {
- header("Location: members.php");
- exit();
- }
- }
- else
- {
- header("Location: index.php?showerror=1");
- exit();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement