Is there a way to display URLS depending on user access level.
I have a MySQL database holding Username/Password/Userlevel.
Is it possible when the user has been validated that their access level is checked and then the relevant URLs are displayed.
ie..
User1 access level1 -Url A
User2 access level2 -Url A & Url B
USer3 access level3 -UrlA & UrlB & UrlC
Thanks
URL view by User Level
Moderator: General Moderators
Er...
Better, actually, to use a switch(), but I'll leave you to look at that yourself...
Code: Select all
<?php
if ($userlevel >= 1)
{
print "<a href="blah.php">This</a>";
}
if ($userlevel >= 2)
{
print "<a href="blah2.php">This2</a>";
}
// etc...- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
Code: Select all
Table Name - apps /*stores application & access rules*/
| id | name | url | access_level |
| 01 | Bond | http://van-dame.com/1 | 1 |
| 02 | Pond | http://van-dame.com/2 | 2 |
| 03 | Cond | http://van-dame.com/3 | 3 |edit: btw the last entry (3) will show in both levels i.e. 1 & 2 ( 1|2 = 3
Last edited by n00b Saibot on Thu Oct 27, 2005 8:35 am, edited 1 time in total.
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
see my edit. i think i will explain more...
i store permissions in bits-form (saves space
)
i.e.
> lowest level - 1
> middle level - 2
> top level - 4
therefore
> links for all - 4|2|1 = 7
> links for med & top - 4|2 = 6
> links for top & lowest - 4|1 = 5
in this way i can easily isolate any two levels without having to implement extra checks
i store permissions in bits-form (saves space
i.e.
> lowest level - 1
> middle level - 2
> top level - 4
therefore
> links for all - 4|2|1 = 7
> links for med & top - 4|2 = 6
> links for top & lowest - 4|1 = 5
in this way i can easily isolate any two levels without having to implement extra checks
-
spudmclard
- Forum Newbie
- Posts: 16
- Joined: Thu Oct 27, 2005 3:06 am