Jump to content

How to display a hyperlink depending on session value [RESOLVED]


AdRock

Recommended Posts

I am trying to display a hyperlink on if the $_SESSION['user_level'] is 3

If the user is logged in and the session not started the link doesn't appear.  Also if the user level is 0, 1, 2 the link doesn't appear

I tried using something like i used in the my login
[code]<?
if(isset($_SESSION["username"])) {
    echo "<a class='one' href='/logout'>Logout</a>";
} else {
    echo "<a class='one' href='/login'>Login</a>";
}
?>[/code]

I tried using [b]if(isset($_SESSION["username"]=3))[/b] but it threw up an error

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.