Hi, All
I would like my user to click on My Account link, with the help of some PHP magic i would like to determine which access level a user has and direct them accordingly to the right my account page.
In total I have 3 types of users outlined below.
I have an Enum set for the user type in the database 0 = normal user and 1 gold user and 2 = admin.
Normal user and gold user has different my account, in each my account there are different option.
I have stored the account type in a session and also in a cookies but not exactly sure how I can direct a user to the right My Account page.
My attempt:
session_start();
if (!$_SESSION['uid']) {
$msgToUser = '<br /><br /><font color="#FF0000">Logged in users can only view this</font>
<p><a href="register.php">Join Here</a></p>
<p><a href="login.php">login</a></p>';
include_once 'msgToUser.php';
exit();
}else if ($_SESSION['type']='1') {
header("location: goldaccount.php?id=$uid");
}else if ($_SESSION['type']= '0') {
header("location: myacount.php");
}
?>
Hope I have explained it properly
Thanks in advance