Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Side Login


Guest

Recommended Posts

Hi

 

I've made a side login box by ripping some of the code from the login.php page, and so far have managed to make it change from the login form to a links box when you login. However, when i logout, the links box remains and the login box does not return.

 

Im not sure what part of the code on the login page switches it back. Below is the code i have so far for my "login_side.php" file which is included into the "column_right.php".

 

If anyone can help me figure out how to get it to display the login box again when you logout, i would appreciate it :blink:

 

<?php
/*
 $Id: best_sellers.php,v 1.21 2003/06/09 22:07:52 hpdl Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/
?>
<link rel="stylesheet" href="../../stylesheet.css" type="text/css">
<?
if ($messageStack->size('login') > 0) {

// The login box

?>
<!-- best_sellers //-->
         <tr>
           <td>
	 <table width="100%" cellspacing="0">
   <tr>
  	 <td class="infoBoxHeading" style="width: 100%; height: 14px; padding-left: 10px;">Login</td>
   </tr>
   <tr>
  	 <td class="infoBoxContents" style="width: 100%; border: 1px solid red; padding: 3px;">
     <form method="post" action="login.php?action=process">
    	 <table>
       <tr>
      	 <td align="right" class="boxText"><b>Email: </b></td>
         <td class="boxText"><input type="text" name="email_address" size="10" class="boxText"></td>
       </tr>
       <tr>
      	 <td align="right" class="boxText"><b>Pass: </b></td>
         <td class="boxText"><input type="password" name="password" size="10" class="boxText"></td>
       </tr>
       <tr>
      	 <td colspan="2" align="center">
         <input type="submit" value="Log In" class="boxText">
      	 </td>
       </tr>
       <tr>
      	 <td colspan="2" class="boxText" align="center">
         <a href="create_account.php">REGISTER</a>
      	 </td>
       </tr>
    	 </table>	
     </form>
  	 </td>
   </tr>
   
	 </table>
           </td>
         </tr>
<?
}
else{
// the links box
?>


         <tr>
           <td>
	 <table width="100%" cellspacing="0">
   <tr>
  	 <td class="infoBoxHeading" style="width: 100%; height: 14px; padding-left: 10px;">Your Account</td>
   </tr>
   <tr>
  	 <td class="infoBoxContents" style="width: 100%; border: 1px solid red; padding: 3px;">
     <a href="<?php echo tep_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>">» Account Details</a><br>
     <br>
    	 <a href="<?php echo tep_href_link(FILENAME_SHOPPING_CART); ?>">» View Order</a><br>
     <br>
    	 <a href="<?php echo tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>">» Checkout</a><br>
     <br>
     <a href="<?php echo tep_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>">» Logout</a><br>
     <br>
  	 </td>
   </tr>
   
	 </table>
           </td>
         </tr>
<?
}?>

 

I should also say at this point im not sure what the whole "$messageStack->size()" actually does

Link to comment
Share on other sites

Try this instead - somebody has already done the hard work and coded it for you:)

 

http://www.oscommerce.com/community/contri...11/search,login

Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem....

Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums.....

if (stumped == true) {

return(square_one($start_over)

} else {

$random_query = tep_fetch_answer($forum_query)

}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...