smashmouth Posted April 12, 2009 Share Posted April 12, 2009 Hello all, I am new to using PHP and I am trying to learn as much as I can so I don't have to pay my coder for simple things lol. Anyways, I am sorry if this is in the wrong place, but I am ripping my hair out. I want a "Interview Room" button to only show when the user is logged in to get to interviews. My last coder has it as "Join Chat" and when I look in the header to find out how he did it it only shows as {{Join Chat}} and I can't find where that is anywhere on my site lol. Anyways, if someone could please help it would be much appreciated. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/153691-hiding-a-header-button-to-non-registered/ Share on other sites More sharing options...
MasterACE14 Posted April 12, 2009 Share Posted April 12, 2009 I'm assuming you would have some kind of session variable which you could check whether it is set or not. you can do something like this... <?php if(isset($_SESSION['var'])) { echo "interview room button goes here"; } ?> Regards, ACE Quote Link to comment https://forums.phpfreaks.com/topic/153691-hiding-a-header-button-to-non-registered/#findComment-807681 Share on other sites More sharing options...
smashmouth Posted April 12, 2009 Author Share Posted April 12, 2009 So use that exact code? and it will work? Here is my current header code: Home</a> | <span class="menu">{{register}} </span>{{seperator1}} <a href="mail.php" class="menu"> Mail</a> <span class="menu"> {{mailcount}}</span>| <a href="categoryboardview.php" class="menu"> Boards</a> | <span class="menu"><a href="account.php" class="menu"> Account</a></span> | <a href="watched.php" class="menu">Watched</a> | <a href="mysite" class="menu"><span class="menu">Partners</span></a> | <span class="menu">{{joinchat}}</span> {{seperator2}}<a href="admin.php" class="menu">{{adminli}}</a> {{seperator}} <a href="userstat.php" class="menu"> {{userstat}}</a></div></td> I am trying to add the "Interview Room" button in but I don't get where the heck to put it. I know how to put it up on the site, but I can't make it dissapear when not logged in.. Sorry if this sounds dumb Quote Link to comment https://forums.phpfreaks.com/topic/153691-hiding-a-header-button-to-non-registered/#findComment-807682 Share on other sites More sharing options...
revraz Posted April 12, 2009 Share Posted April 12, 2009 Search on how to use sessions in PHP. Quote Link to comment https://forums.phpfreaks.com/topic/153691-hiding-a-header-button-to-non-registered/#findComment-807684 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.