I was asked by a couple people to post the code for my login page. Here you go.
In catalog/login.php replace everything above:
CODE
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
with
CODE
<?php
/*
$Id: login.php,v 1.2 2002/11/29 00:08:06 wilt Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
require('includes/application_top.php');
if ($HTTP_POST_VARS['action'] == 'process') {
$email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
$password = tep_db_prepare_input($HTTP_POST_VARS['password']);
// Check if email exists
$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_password, customers_email_address, customers_default_address_id from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . "'");
if (!tep_db_num_rows($check_customer_query)) {
$HTTP_GET_VARS['login'] = 'fail';
} else {
$check_customer = tep_db_fetch_array($check_customer_query);
// Check that password is good
if (!validate_password($password, $check_customer['customers_password'])) {
$HTTP_GET_VARS['login'] = 'fail';
} else {
$check_country_query = tep_db_query("select entry_country_id, entry_zone_id from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . $check_customer['customers_id'] . "' and address_book_id = '1'");
$check_country = tep_db_fetch_array($check_country_query);
$customer_id = $check_customer['customers_id'];
$customer_default_address_id = $check_customer['customers_default_address_id'];
$customer_first_name = $check_customer['customers_firstname'];
$customer_country_id = $check_country['entry_country_id'];
$customer_zone_id = $check_country['entry_zone_id'];
tep_session_register('customer_id');
tep_session_register('customer_default_address_id');
tep_session_register('customer_first_name');
tep_session_register('customer_country_id');
tep_session_register('customer_zone_id');
setcookie('email_address', $email_address, time()+2592000, substr(DIR_WS_CATALOG, 0, -1));
$date_now = date('Ymd');
tep_db_query("update " . TABLE_CUSTOMERS_INFO . " set customers_info_date_of_last_logon = now(), customers_info_number_of_logons = customers_info_number_of_logons+1 where customers_info_id = '" . $customer_id . "'");
// restore cart contents
$cart->restore_contents();
if (sizeof($navigation->snapshot) > 0) {
$origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
$navigation->clear_snapshot();
tep_redirect($origin_href);
} else {
tep_redirect(tep_href_link(FILENAME_DEFAULT));
}
}
}
} elseif ($HTTP_POST_VARS['action'] == 'new') {
$email_address = 'email_address=' . tep_db_prepare_input($HTTP_POST_VARS['email_address']);
tep_redirect(tep_href_link(FILENAME_CREATE_ACCOUNT, $email_address, 'SSL'));
}
require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN);
$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_LOGIN, '', 'SSL'));
?>
Then replace everything that comes between
CODE
<!-- body_text //-->
and
CODE
<!-- body_text_eof //-->
with
CODE
<td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
if ($HTTP_GET_VARS['login'] == 'fail') {
$info_message = TEXT_LOGIN_ERROR;
} elseif ($cart->count_contents()) {
$info_message = TEXT_VISITORS_CART;
}
if (isset($info_message)) {
?>
<tr>
<td class="smallText" colspan="2"><?php echo $info_message; ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<?php
}
?>
<tr>
<td><?php echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, '', 'SSL')); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="2">
<tr>
<td width="75%" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="1" align="center">
<tr>
<td valign="top">
<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="2">
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td class="main" colspan="2" align="left"><b><?php echo TEXT_EMAIL_QUESTION; ?></b></td>
</tr>
<tr>
<td class="main" align="right"><?php echo ENTRY_EMAIL_ADDRESS_LOGIN; ?></td>
<td class="main" align="left"><?php echo tep_draw_input_field('email_address'); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '20'); ?></td>
</tr>
<tr>
<td class="main" colspan="2" align="left"><b><?php echo TEXT_PASSWORD_QUESTION; ?></b></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td class="main" align="right"><?php echo tep_draw_radio_field('action', 'new') ?></td>
<td class="main" align="left"><?php echo TEXT_NO_PASSWORD; ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
<tr>
<td class="main" align="right"><?php echo tep_draw_radio_field('action', 'process', true) ?></td>
<td class="main" align="left"><?php echo TEXT_HAS_PASSWORD; ?></td>
</tr>
<tr>
<td class="main"><br></td>
<td class="main"><?php echo tep_draw_password_field('password'); ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '25'); ?></td>
</tr>
<tr>
<td><br></td>
<td align="left" valign="top"><?php echo tep_image_submit('button_sign_in_secure.gif', IMAGE_BUTTON_LOGIN); ?></td>
</tr>
<tr>
<td><br></td>
<td class="smallText" align="left"><br><?php echo '<a href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?></td>
</tr>
<tr>
<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</form>
<td width="25%" valign="top" class="loginInfo">
<?php echo TEXT_SAFE_SHOPPING; ?>
<p>
<?php echo TEXT_SAFE_SHOPPING2; ?>
<p>
<?php echo TEXT_SAFE_SHOPPING3; ?>
</td>
</tr>
</table>
</td>
That should be right anyway, but let me know if it's not.
Then my login.php language file looks like:
CODE
<?php
/*
$Id: login.php,v 1.1.1.1 2002/11/28 23:22:07 wilt Exp $
osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com
Copyright (c) 2002 osCommerce
Released under the GNU General Public License
*/
if ($HTTP_GET_VARS['origin'] == FILENAME_CHECKOUT_PAYMENT) {
define('NAVBAR_TITLE', 'Order');
define('HEADING_TITLE', 'Ordering online is easy.');
define('TEXT_STEP_BY_STEP', 'We'll walk you through the process, step by step.');
} else {
define('NAVBAR_TITLE', 'Login');
define('HEADING_TITLE', 'Sign in or create a new profile');
define('TEXT_STEP_BY_STEP', ''); // should be empty
}
define('TEXT_EMAIL_QUESTION', ' What is your email address:');
define('TEXT_NO_PASSWORD', 'No, I am a new customer.');
define('TEXT_HAS_PASSWORD', 'Yes, I am a returning customer<br>and my password is:');
define('ENTRY_EMAIL_ADDRESS_LOGIN', 'My email address is:');
define('TEXT_PASSWORD_QUESTION', ' Do you have a Badmouthmovies password?');
define('TEXT_SAFE_SHOPPING', '<b>Safe Shopping Guarantee</b><br>Badmouthmovies.com guarantees that every transaction you make at Badmouthmovies.com will be safe.');
define('TEXT_SAFE_SHOPPING2', '<b>Privacy & Security</b><br>All your information is safe and secure. The entire transaction will take place on a secure server using SSL technology.');
define('TEXT_SAFE_SHOPPING3', '<b>FEEDBACK/PROBLEMS?</b><br>Your comments will help us to improve our checkout process.<br><a href="' . tep_href_link(FILENAME_CONTACT_US, '', 'NONSSL') . '">Contact us</a>');
define('TEXT_PASSWORD_FORGOTTEN', 'Password forgotten? Click here.');
define('TEXT_LOGIN_ERROR', '<font color="#ff0000"><b>ERROR:</b></font> No match for 'E-Mail Address' and/or 'Password'.');
define('TEXT_VISITORS_CART', '<font color="#ff0000"><b>NOTE:</b></font> Your "Visitors Cart" contents will be merged with your "Members Cart" contents once you have logged on. <a href="javascript:session_win();">[More Info]</a>');
?>
Let me know of any problems.