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 Link to comment https://forums.phpfreaks.com/topic/18674-how-to-display-a-hyperlink-depending-on-session-value-resolved/ 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 Link to comment https://forums.phpfreaks.com/topic/18674-how-to-display-a-hyperlink-depending-on-session-value-resolved/#findComment-80490 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. Link to comment https://forums.phpfreaks.com/topic/18674-how-to-display-a-hyperlink-depending-on-session-value-resolved/#findComment-80491 Share on other sites More sharing options...
AdRock Posted August 25, 2006 Author Share Posted August 25, 2006 Yep...that worked fine...thanks dudes Link to comment https://forums.phpfreaks.com/topic/18674-how-to-display-a-hyperlink-depending-on-session-value-resolved/#findComment-80494 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.