-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrouter.php
executable file
·61 lines (36 loc) · 921 Bytes
/
router.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
include"master_inc.php";
$username_from_cookie = $_COOKIE[$cookiename]; //retrieve contents of cookie
//Query to get permissions
$query = "SELECT * FROM users WHERE `username` = '$username_from_cookie'";
$numresults=mysql_query($query);
$numrows=mysql_num_rows($numresults);
// get results
$result = mysql_query($query) or die("Couldn't execute query");
// now you can display the results returned
while ($row= mysql_fetch_array($result)) {
$permissions = $row["permissions"];
//Set Rules for where various permissions go after login
if($permissions==5)
{
header("location:$level_5_url");
}
if($permissions==4)
{
header("location:$level_4_url");
}
if($permissions==3)
{
header("location:$level_3_url");
}
if($permissions==2)
{
header("location:$level_2_url");
}
if($permissions==1)
{
header("location:$level_1_url");
}
}
//}
?>