Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer Login Box


Guest

Recommended Posts

Can anyone see from the code below how to get rid of this gap between the table header and the box?

 

gap.jpg

 

<?php
/*

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

 Copyright (c) 2002 osCommerce

 Released under the GNU General Public License

 IMPORTANT NOTE:

 This script is not part of the official osC distribution
 but an add-on contributed to the osC community. Please
 read the README and  INSTALL documents that are provided 
 with this file for further information and installation notes.

 loginbox.php -   Version 2.0
 This puts a login request in a box with a login button.
 If already logged in, will not show anything. Loginbox altered by [email protected] on 7/03/03
 

*/
?>
<!-- loginbox //-->
<?php
   if (!tep_session_is_registered('customer_id')) {
?>
         
               <tr> 
             <td colspan=3 width="100%"> <img src="images/boxes/table_login.jpg"></td>
           </tr>  
   <tr>
     <td> 
   <table width="125" border="0" cellspacing="1" cellpadding="0" class="infoboxborder">
     <tr>
       <td>          <table width=100% border=0 cellpadding=0 cellspacing=0 class="infoBoxContents">
	 <tr> 
             <td class="main"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    	 </tr>
    	 

 <tr> 
   <td class="main">Welcome <span class="greetUser">Guest!</span> To login, fill 
     out the form below. </td>
 </tr>
</table></td>
    </tr>
           <tr> 
             <td> 
               <?php
   $loginboxcontent = "
           <table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">
           <form name=\"login\" method=\"post\" action=\"" . tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL') . "\">
             <tr>
               <td align=\"left\" class=\"main\">
                 " . BOX_LOGINBOX_EMAIL . "
               </td>
             </tr>
             <tr>
               <td align=\"left\" class=\"main\">
                 <input type=\"text\" name=\"email_address\" maxlength=\"96\" size=\"10\" value=\"\">
               </td>
             </tr>
             <tr>
               <td align=\"left\" class=\"main\">
                 " . BOX_LOGINBOX_PASSWORD . "
               </td>
             </tr>
             <tr>
               <td align=\"left\" class=\"main\">
                 <input type=\"password\" name=\"password\" maxlength=\"40\" size=\"10\" value=\"\"
               </td>
             </tr>
             <tr>
               <td class=\"main\" align=\"center\">
                 " . tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN) . "
               </td>
             </tr>
           </form>
           </table>
             ";

   $info_box_contents = array();
   $info_box_contents[] = array('align' => 'center',
                                'text'  => $loginboxcontent
                               );
   new infoBox($info_box_contents);
?>
             </td>
           </tr>
	 <tr> 
             <td class="main">
   <table width="100%" border="0" cellspacing="0" cellpadding="1">
 <tr>
   <td class="main">New customer? Click <a href="<?php echo tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'); ?>"><u>here</u></a> 
     to create an account. </td>
 </tr>
</table> 
    </td>
    </tr>
         </table>
       </td>
     </tr>
   </table>
   
 </td>
         </tr>
<?php
 }
 else
 {
 echo<<<LONG
 <tr>
 <td> 
   <table width="144" border="0" cellspacing="0" cellpadding="1" class="infoboxborder">
     <tr>
       <td>          <table width=100% border=0 cellpadding=0 cellspacing=0 class="infoBoxContents">
           <tr> 
             <td colspan=3 width="100%"> <img src="images/boxes/table_login.jpg"></td>
           </tr>
           <tr> 
             <td>                
           <table border="0" width="100%" cellspacing="0" cellpadding="5">
           <tr>
               <td align="left" class="main">
                 Welcome <b>$customer_first_name</b>. You are currently logged in.<p>To logout, click <b><a href="logoff.php">here</a></b>.</p>
     </td>
             </tr>
           </table>
            </td>
           </tr>
         </table>
       </td>
     </tr>
   </table>    
 </td>
         </tr>
LONG;
 }?>
<!-- loginbox_eof //-->

Link to comment
Share on other sites

Just a thought, but try changing the table it's in that has cellpadding="2" to "0" and see what happens. You may have to include it in its own table to get around this.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

You just need to insert a <table> at the appropriate place. However, your table should not have disappeared when you changed the cellpadding. I would wait until that was sorted out before making any other changes. If you have FrontPage or Dreamweaver you can open your home page up in one of those and play around with the settings. This should make it easier for you to see what is going on and to add a table as needed.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

  • 2 weeks later...

While looking at your site in your browser, select Save As from the File menu. Select somewhere to save it so that you can find it with DW. It will save your page as an .htm file and will also create a directory with various files. Open the .htm file in DW and it should look just like the page you saved. Note that this is a one-way street - you cannot upload that page from DW. This is just a quick way to troubleshoot the kind of problem you are having. You can edit it all you want, then look at the code once you are happy with the result and copy that code to the correct file of your shop.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Try mine if you'd like. I think it looks nice anyway. ;) Note though, it looks like I have a more recent version as the box doesn't display when a customer is logged in.

 

<?php
// do not display if logged in

if ( (!strstr($_SERVER['PHP_SELF'],'login.php'))
and
(!strstr($_SERVER['PHP_SELF'],'create_account.php'))
and
!tep_session_is_registered('customer_id')
)          {
?>
<!-- loginbox //-->
<?php
   if (!tep_session_is_registered('customer_id')) {
?>
         <tr>
           <td>
<?php
   $info_box_contents = array();
   $info_box_contents[] = array('text'  => BOX_HEADING_LOGIN_BOX);

       new infoBoxHeading($info_box_contents, false, false);

$loginboxcontent = tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL'))
                                                                 . BOX_LOGINBOX_EMAIL
                                                                 . tep_draw_input_field('email_address', '', 'size="10" maxlength="100" style="width: ' . (BOX_WIDTH-30) . 'px"')
                                                                .'<br>'
                                                                . BOX_LOGINBOX_PASSWORD
                                                                . tep_draw_password_field('password', '', 'size="10" maxlength="40" style="width: ' . (BOX_WIDTH-30) . 'px"')
                                                                .'<a href="'
                                                                . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL')
                                                                . '">'
                                                                . BOX_LOGINBOX_FORGOT_PASSWORD
                                                                . '</a>'
                                                                . tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN)
                                                                . '</form><br><br>'
                                                                .  BOX_LOGINBOX_TEXT_NEW
                                                                . '<a href="'
                                                                . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')
                                                                . '">'
                                                                . BOX_LOGINBOX_NEW
                                                                . '</a>'
                                                               ;

$info_box_contents = array();
   $info_box_contents[] = array('align' => 'center',
                                'text'  => $loginboxcontent);
   new infoBox($info_box_contents);
?>
           </td>
         </tr>
<?php
 } else {
 // If you want to display anything when the user IS logged in, put it
 // in here...  Possibly a "You are logged in as :" box or something.
 }
?>
<!-- loginbox_eof //-->
<?php
// My Account Infobox
} else {
 if (tep_session_is_registered('customer_id')) {
?>

<!-- my_account_info //-->
         <tr>
           <td>
<?php
 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
                              'text'  => BOX_HEADING_LOGIN_BOX_MY_ACCOUNT);
 new infoBoxHeading($info_box_contents, false, false);

 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
                              'text'  =>
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">' . LOGIN_BOX_MY_ACCOUNT . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_EDIT . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . LOGIN_BOX_ADDRESS_BOOK . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') . '">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><br>' .
                                         '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') . '">' . LOGIN_BOX_LOGOFF . '</a>');
 new infoBox($info_box_contents);
?>
           </td>
         </tr>
<!-- my_account_info_eof //-->

<?php
 }

}

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...