View Full Version : Conditional display

09-26-2008, 02:15 PM
Hey Guys, it's been a long time.

I have the following question, probably a simple issue for you PHP experts :)

I have a menu

item1 | item2 | item3 | item4

I need to hide items 3 and 4 from other users. There is a login page and a db that provides access levels. Basically, Access level 1, can see al menu items and access level 2 only items 1 and 2.

In asp I would just do something like:

item1 | item2 <%if intAccessLevel = 1 then %>| item3 | item4<%else%><%end if%>

How would I do that using PHP?
Thanks for any help I can get,


09-26-2008, 03:27 PM
<?php if($AccessLevel == 1){ ?> | item3 | item4 <?php } ?>

09-26-2008, 04:32 PM
Thanks Lux. Not resolved yet but, perhaps my login code has something to do with it. I'm looking into it.