T
|
Tempus_Erus 4/7/2019 |
Hello, I want to redirect user, based on GroupID, to a specific page after login. I apply the following event code on After successful login, however, it only re direct for default user group. Admin user can't be re directed but to menu page. Can anyone please share what have I missed? Thank you. ========= if ($_SESSION["GroupID"]="default"){ header("Location: default_pg_default_view.php?editid1=1"); exit(); } if ($_SESSION["GroupID"]="admin"){ header("Location: newsmain_list.php"); exit(); Have a look at : https://xlinesoft.com/tiki/Built-in+session+variables Also should the = not be == } ========= |
![]() |
Admin 4/8/2019 |
This is incorrect: $_SESSION["GroupID"]="default"
$_SESSION["GroupID"]=="default" |
J
|
jianwong author 4/8/2019 |
|
J
|
jianwong author 4/8/2019 |
This is incorrect: $_SESSION["GroupID"]="default"
$_SESSION["GroupID"]=="default"
$_SESSION["GroupID"]="default"
|
![]() |
Admin 4/8/2019 |
I already pointed to what is wrong. I don't know what else can be added here. You are using an assignment operator instead of comparison operator. This is wrong and won't work. |