This topic is locked
[SOLVED]

 Redirect After Login Depending On The User Group

1/27/2013 08:26:36
PHPRunner General questions
J
joiresende author

How could I redirect to a different page after login depending on the user group.

tried the code below but it does not work.
if ($session['Userid'] == 'user')

{

header ("Location: pag1_report.php");

}

else

if ($session['Userid'] == 'admin')

{

header ("Location: pag2_report.php");

}
exit ();

C
cgphp 1/27/2013
if($_SESSION['UserID'] == 'user')

{

header("Location: pag1_report.php");

}

else

{

header("Location: pag2_report.php");

}

exit();
J
joiresende author 1/27/2013

Thanks worked perfectly, except that I changed the 'Userid' for 'GroupID'
if($_SESSION['GroupID'] == 'super')

{

header("Location: pag1_report.php");

}

else

{

header("Location: pag2_report.php");

}

exit();