I am pretty sure I did everything correctly since have it works and other half does not. I wanted to setup the script so that when the user logs in, it redirects to a specific page such as user1 goes to user1.php, user2 goes to user2.php, and so on. I only need 10 users and 1 admin for this project. Now to do this I did the following:
Edited constants.php proclogin() so that it now looks like this:
And everything works sort of works except team1 does not redirect to team1.php (it goes to the default page, main.php), however team2 and team3 do redirect to their specified pages. I can't figure out why team2 and team3 redirect but team1 does not.
Also, if add another user redirect so that it looks like this:
It totally stops working, and nothing redirects and they all go to the main.php default page. Seems like it can't handle more than 3 (or maybe 2) redirects this way?
I've been pulling my hair out this and just can't seem to wrap my head around why this is not working! Any help at all is greatly appreciated!
Thank you!
Edited constants.php proclogin() so that it now looks like this:
- Code:
/* Login successful */
if($retval){
if(strcmp($session->username, "team1") == 0){
header("Location: team1.php");
}
if(strcmp($session->username, "team2") == 0){
header("Location: team2.php");
}
if(strcmp($session->username, "team3") == 0){
header("Location: team3.php");
}
else{
header("Location: ".$session->referrer);
}
}
And everything works sort of works except team1 does not redirect to team1.php (it goes to the default page, main.php), however team2 and team3 do redirect to their specified pages. I can't figure out why team2 and team3 redirect but team1 does not.
Also, if add another user redirect so that it looks like this:
- Code:
/* Login successful */
if($retval){
if(strcmp($session->username, "team1") == 0){
header("Location: team1.php");
}
if(strcmp($session->username, "team2") == 0){
header("Location: team2.php");
}
if(strcmp($session->username, "team3") == 0){
header("Location: team3.php");
}
if(strcmp($session->username, "team4") == 0){
header("Location: team4.php");
}
else{
header("Location: ".$session->referrer);
}
}
It totally stops working, and nothing redirects and they all go to the main.php default page. Seems like it can't handle more than 3 (or maybe 2) redirects this way?
I've been pulling my hair out this and just can't seem to wrap my head around why this is not working! Any help at all is greatly appreciated!
Thank you!