Hi,
I have about 10 scripts on my site and want to restrict access for 1 user to just 2 scripts.
When this particular user logs in, they are assigned the number '2' to their SESSION['user_category'] variable.
Every script has an include file included(include('../header.php')which verifies what user category they are in...something like....
I'm wondering if there's an easy way to group these scripts(an array?) and then say which ones only category2 can access etc. Basically so if they try to visit a script which they don't have access to, they're redirected.PHP Code:if ($_SESSION['user_category'] == '1') {
// gives them access to everything
} elseif ($_SESSION['user_category'] == '2') {
// just access to 2 scripts
}
Does this make sense?
I'm sure it's just a case of using an array, determining the current page and taking action with the if statement.
Many thanks for any advice on this.



which verifies what user category they are in...something like....

Bookmarks