Hi,

I need a little help on something. I
'm trying to write a script that has to display different variables according to which user is logged in.
My plan is to create a txt file on the server for each user that contains the accessrights for that user.
Lets say that in a menu I have option A to D. The logged in user is only allowed to see option A and C.

There is a database in which the options for the menu are stored so in fact I want to compare which of the options (A to D) are also in the txt file containing the users access rights.

I have tried some things but it's not really working out. How to do this? Maybe I'm just barking up the wrong tree and there is a much easier way to do this??

Any help would be greatly appreciated 🙂

Thanks

    I have a accessLevel column for my user database...the levels go from 0 - 100

    so on pages i need restricted to level 100 only i have

    if ($accessLevel == "100")
    {
    echo "<a href='blah.php'> ADMIN ONLY</a><br>";
    }
    

    so non accessLevel 100 people don't even see that menu option.
    and if they try doing http://blah.com/blah.php to try to supercede the invisible menu option i have a function that checks for access level at the top of the page (every page, actually) that re-directs them back to the login if they attempt to see that page w/o having proper priviledges.

      on my site, every user has a user level, 1, 2 and 3. 3 is an admin, 2 is a mod and 1 is a normal user which is stored in the database. 4 is also a banned user. Now if I want something that the 2's and 3's can only do i go something like

      if ($userlevel == 2 || $userlevel == 3) {
      
      echo "Blah";
      
      }
      

      then that way the level 1 users cant see it.

        Write a Reply...