Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with Syntax


1Putts

Recommended Posts

I'm trying to create a little login thing in the header. So if they are not logged in, it says "Login / Create Account" with a link to the secure login.php page.

 

If they are logged in, it says, "You are currently logged in as <insert Customer's First Name Here>"

 

Here's what I have so far:

<td class="smallTextBold">
<?php
if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
echo 'You are currently logged in as ';
} else {
echo '<a href="login.php">Login or Create Account</a>';
}
?>
</td>

 

I've set global $customer_first_name; at the top of the header. So I need to get that in there somehow and I also need to be able to maintain the OsCID using the standard linking procedure:

<a href="<?php echo tep_href_link('account.php')?>">Login / Create an Account</a>

 

I just can't seem to get the syntax right for both the insering of the customer's first name and the link to the secure login page maintaining the OsCID. Thanks for any help you can provide.

Link to comment
Share on other sites

try this:

 

<td class="smallTextBold">
<?php
if ( tep_session_is_registered('customer_id')) {
echo 'You are currently logged in as ' . $customer_first_name;
} else {
echo '<a href="' . tep_href_link('account.php') . '">Login / Create an Account</a>';
}
?>
</td>

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...