AdRock Posted August 25, 2006 Share Posted August 25, 2006 I am trying to display a hyperlink on if the $_SESSION['user_level'] is 3If 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 appearI 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 Quote Link to comment Share on other sites More sharing options...
tomfmason Posted August 25, 2006 Share Posted August 25, 2006 try this[code=php:0]if ($_SESSION['userlevel'] == 3) { echo '<a href="somepage.php">Userlevel 3</a>';}[/code]hope this helps Quote Link to comment Share on other sites More sharing options...
Orio Posted August 25, 2006 Share Posted August 25, 2006 [code=php:0]if($_SESSION["username"]==3){echo("link");}[/code][hr]Orio. Quote Link to comment Share on other sites More sharing options...
AdRock Posted August 25, 2006 Author Share Posted August 25, 2006 Yep...that worked fine...thanks dudes Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.