This topic is locked

How to dynamically set landing page based on usergroups

3/17/2011 5:57:38 PM
PHPRunner General questions
Y
yksafo author

How would I dynamically set the landing page for users based on the usergroups.
I would like users belonging to a certain usergroup to be redirected to a specific page instead the one everyone else does.

E
electromotive 3/20/2011



How would I dynamically set the landing page for users based on the usergroups.
I would like users belonging to a certain usergroup to be redirected to a specific page instead the one everyone else does.



I do this, and the way I did it was to create a table with groups or users (or this can be part of the user table), and the url of the page they land on. Then in the 'after successful login' event, I lookup the group or user and (after other things) do the redirect:

//********** Redirect to another page ************

if ($_SESSION["InitialPage"]){

$loc = "Location: ".$_SESSION["InitialPage"];

header($loc);

exit();

}