Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Logoff & Login


doby48

Recommended Posts

In header.php I like how you are only shown the Log Off link if you are already logged in. However, I would like to change this slightly to show Login if you are not logged in, or show Log Off if you are logged in. I am just learning PHP and having a bit of trouble changing this. I tried to do an else statement with the if for displaying the Log Off, but I must have messed up somewhere as I keep getting errors. I would really appreciate it if someone could post the logic for a statement like this.

 

Thanks in advance!

Remember... Pillage BEFORE you burn!

Link to comment
Share on other sites

I presume you are using a standard osc header file so,

In catalog/includes/header.php, find the following around line 60:

 

<?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php } ?>

 

and replace with:

 

<?php if (tep_session_is_registered('customer_id')) { ?><a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGOFF; ?></a>  |  <?php }else{ ?><a href="<?php echo tep_href_link(FILENAME_LOGIN, '', 'SSL'); ?>" class="headerNavigation"><?php echo HEADER_TITLE_LOGIN; ?></a>  |  <?php } ?>

Link to comment
Share on other sites

Gotta laugh ...

 

Been looking at my own code on so many sites lately I thought that was standard ... :roll:

 

Have to remember ... I habitually make a set of changes right after loading a site for convenience.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...