forked from anubhav1433/ClubHubU
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserRedirect.php
45 lines (37 loc) · 923 Bytes
/
userRedirect.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
<?php
session_start();
if(isset($_GET['user'])){
if($_GET['user'] == 'admin')
{
header("location: admin/index.php");
}
else if($_GET['user'] == 'moderator')
{
header("location: moderator/index.php");
}
else if($_GET['user'] == 'student')
{
header("location: homepage/?id=".$_SESSION['username']);
}
else{
header("location: login.php");
}
}
else{
if($_SESSION['userType'] == 'admin')
{
header("location: admin/index.php");
}
else if($_SESSION['userType'] == 'moderator')
{
header("location: moderator/index.php");
}
else if($_SESSION['userType'] == 'student')
{
header("location: homepage/?id=".$_SESSION['username']);
}
else{
header("location: login.php");
}
}
?>