Right.. i havent asked i question in quite a while now but... here it goes.. im making a members script for the new version of xEnigmA and i want it so if your rank is admin you can edit/delete/add things once you have logged in.
In the MySql Db the rows for this member script are:
ID (Obviously)
UserName
Password
Rank**
Avatar
There are going to be 2 ranks Admin & Member just for now. And i want it so, if your rank is admin you can view the add/delete/edit news part but if you are just a member it will be a blank page. So far to view the menu when you have logged in i am using this:
The session for that is:PHP Code:<?
if (isset($_SESSION['username'])) { // Allows you to view the menu if you're logged in
echo "Menu.";
include ('add.php');
}else{ // If not It displays this
echo "You must login to view the Members Menu.";
}
?>
ive also made one for the rankPHP Code:$_SESSION['username'] = $row['username'];
I tried something like this for it but it didnt work it just displayed the "Your not logged in message:PHP Code:$_SESSION['rank'] = $row['rank'];
But as i said it didnt work it just displayed the "You are not an admin" message. Does anybody know how i could do this?PHP Code:<?
if ($_SESSION['rank']=="Admin") { // If you are logged in and your members rank is Admin Display this
echo "Admin Area";
include ('add.php');
}else{ // If not It displays this
echo "You Are not an admin.";
}
?>
What i want to know how to do is.
*If you are logged in and your rank is Admin you can view the page, and if not, you get a message saying you are not.
I havent tried using a rank system like this before and i cannot remember what i have previously done, Help!





I havent tried using a rank system like this before and i cannot remember what i have previously done, Help!


