Forum Moderators: coopster
I have a system which requires logging on etc etc.
Each user is assigned one of three levels, 0, 1 or 2
Most functions/pages can be viewed by all, some can only be viewed by 1 and some by 2 etc etc.
To work this, and instead of having different pages for different users etc, I have else and if statements on the page:
<?
if ($level == 1) {
?>
Info for Level 1 users
<?
}
?>
<?
if ($level == 2) {
?>
Info for Level 2 users
<?
}
?>
What I now need to be able to do is to have an if statement which can handle level 1 AND 2 users at the same time.
Sort of:
if ($level == 1 OR 2)
Does anybody know how this could be done?
Kindest Regards,
William.
you can then have drop through cases
switch($level){
case 0:
do stuff;
break;
case 1: //this case will drop through to the next because of the missing break
case 2:
do other stuff;
break;
*always replace "¦" with real pipe character
Andreas
Birdman,
This seems the most simplest and easiest way to do what I need to do, and it works fine...Thank You
Andreas,
Very good post that you refer to..unfortunately this little bit was only needed at the last minute :(, and I don't have the time to change all the other parts of the systemto use the method you explained. No doubt it will come in very handy one day ;)
Thanks again,
William.