Skip to content
Advertisement

For some reason. IF statement is working….Ive tried If/else with no luck either [closed]

Only the ‘Admin’ if statement runs correctly. Anything else will jump to the un-nested else…any reason as to why?

Note: Yes, I’ve checked the spelling of the ranks…they are spelled correctly

Will redirect after user has succesfully logged in (login-sucessful.php):

JavaScript

login page (login.php):

JavaScript

Login Table: Login Table

Advertisement

Answer

Wow….Cant believe I just spent an hour on this….its 2am and im exhausted…must be the reason this slipped up…. } elseif ($_SESSION[“rank”] == ‘Faculty’){//Check if Faculty header(“location:/panel/student/profile.php”); } elseif ($_SESSION[“rank”] == ‘Student’){//Check if Student header(“location:/panel/faculty/profile.php”); files linked to wrong directory which forced it to shoot back to login page (cause rank wasnt allowed) Thanks so much guys…I feel like a dumbass…Going to sleep now

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement