Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sign In - Sign Out


Corintheus

Recommended Posts

I have three images in my header: View Basket, Sign In, and Contact Us.

 

What I want to have is the Sign In image change to my Sign Out image if the person is logged in. What code would I have to put in my header for this to work? Currently it's just this:

 

<td align="right" valign="bottom"><div align="right"><a href="shopping_cart.php"><img src="images/viewbasket.jpg" width="98" height="16" border="0"></a><a href="login.php"><img src="images/signin.jpg" width="51" height="16" border="0"></a><a href="contact_us.php"><img src="images/contactus.jpg" width="72" height="16" border="0"></a></div></td>

 

Thanks!

Link to comment
Share on other sites

Change the above code to be

<td align="right" valign="bottom"><div align="right"><a href="shopping_cart.php"><img src="images/viewbasket.jpg" width="98" height="16" border="0"></a><a href="<?php echo ((isset(oscSid) && osCsid != '') ? 'login.php' : 'logout.php') ?>"><img src="images/<?php echo ((isset(oscSid) && osCsid != '') ? 'signin.jpg' : 'signout.jpg' ?>" width="51" height="16" border="0"></a><a href="contact_us.php"><img src="images/contactus.jpg" width="72" height="16" border="0"></a></div></td>

and that should do it (assuming that I am not so tired that I made a syntax error ;) ).

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Yep, I was definitely tired. :oops:

 

Replace the above with the following

<td align="right" valign="bottom"><div align="right"><a href="shopping_cart.php"><img src="images/viewbasket.jpg" width="98" height="16" border="0"></a><a href="<?php echo ((isset($osCsid) && $osCsid != '') ? 'login.php' : 'logout.php'); ?>"><img src="images/<?php echo ((isset($osCsid) && $osCsid != '') ? 'signin.jpg' : 'signout.jpg'); ?>" width="51" height="16" border="0"></a><a href="contact_us.php"><img src="images/contactus.jpg" width="72" height="16" border="0"></a></div></td>

 

Sorry about that.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

To sort the button issue out replace the line above with the following:

<td align="right" valign="bottom"><div align="right"><a href="shopping_cart.php"><img src="images/viewbasket.jpg" width="98" height="16" border="0"></a><a href="<?php echo ((isset($osCsid) && $osCsid != '') ? 'logout.php' : 'login.php'); ?>"><img src="images/<?php echo ((isset($osCsid) && $osCsid != '') ? 'signout.jpg' : 'signin.jpg'); ?>" width="51" height="16" border="0"></a><a href="contact_us.php"><img src="images/contactus.jpg" width="72" height="16" border="0"></a></div></td>

This will cause the appropriate buttons to display.

 

Please PM me your test account details and I will check out the logout issue.

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

The session id is still being retained even though the customer has logged out.

 

Try the following code and let me know if it does not work better for you.

<td align="right" valign="bottom"><div align="right"><a href="shopping_cart.php"><img src="images/viewbasket.jpg" width="98" height="16" border="0"></a><a href="<?php echo ((tep_session_is_registered('customer_id')) ? 'logout.php' : 'login.php'); ?>"><img src="images/<?php echo ((tep_session_is_registered('customer_id')) ? 'signout.jpg' : 'signin.jpg'); ?>" width="51" height="16" border="0"></a><a href="contact_us.php"><img src="images/contactus.jpg" width="72" height="16" border="0"></a></div></td>

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

Glad to hear that we finally got it working for you. :)

"Great spirits have always found violent opposition from mediocre minds. The latter cannot understand it when a man does not thoughtlessly submit to hereditary prejudices but honestly and courageously uses his intelligence." - A. Einstein

Link to comment
Share on other sites

  • 3 months later...

Archived

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

×
×
  • Create New...