doby48 Posted April 15, 2003 Share Posted April 15, 2003 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 More sharing options...
Guest Posted April 15, 2003 Share Posted April 15, 2003 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 More sharing options...
doby48 Posted April 15, 2003 Author Share Posted April 15, 2003 Thanks lango! This is exactly what I was looking for! Remember... Pillage BEFORE you burn! Link to comment Share on other sites More sharing options...
griffin Posted April 20, 2003 Share Posted April 20, 2003 Will this work in MS1? I got grey hair with osCommerce. Link to comment Share on other sites More sharing options...
Ajeh Posted April 20, 2003 Share Posted April 20, 2003 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 More sharing options...
Guest Posted April 20, 2003 Share Posted April 20, 2003 Will this work in MS1? Yes Delores, it works with the MS1. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.