Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Controlling Navigation with PHP Depending on User? Re: Controlling Navigation with PHP Depending on User?

#64758

Yeah that solution seems to be very logical. You might want to consider storing the variable in a PHP session, so that you can reuse it. The best way would be to have the logical expression (the if statement) on the login page, and then a variable is set that contains the path of the navigation, so…

Code:
if($usergroup == 1)
{
$_SESSION[‘nav-path’] = “nav/nav1.php”;
}
else
{
$_SESSION[‘nav-path’] = “nav/nav2.php”;
}

And then when your user visits a page…

Code:

This solution will make it more manageable in the long run. Hope this helps.

-Tom