If you just want something real simple, you can make a permissions table and then in your users table make a user_permissions column. In the permissions table, have an id column and an action column. The id column will just be an auto-incremented id, and the action column will be what you want the permission to be (for example, view_members_only_area, whatever).
Then in your users table, the user_permissions column will be a serialized array containing the id's of all of the permissions you want that user to have from the permissions table.
Then use this function to determine if they have the appropriate permission to do X.
Code:
function has_permission($user_id, $action)
{
$query = mysql_query("SELECT user_permissions FROM users WHERE user_id='" . $user_id . "'");
$user = mysql_fetch_assoc($query);
$perms = unserialize($user['user_permissions']);
$query = mysql_query("SELECT perm_id, perm_action FROM permissions WHERE perm_action='" . $action . "'");
if (mysql_num_rows($query) > 0) {
$perm = mysql_fetch_assoc($query);
if (in_array($perm_id, $user['user_permissions'])) {
return true;
}
}
return false;
}
Finally, you can just do a simple if conditional to see if the user has the appropriate permission.
Code:
if (has_permission($_SESSION['user_id'], 'view_members_only_area') {
echo '<li><a href="#">Members only area</a></li>';
}