Jump to content

Hiding a header button to non registered.


smashmouth

Recommended Posts

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.

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

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 :(

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.