custompony Posted April 28, 2006 Posted April 28, 2006 * $Id: login.php,v 1.14 2003/06/09 22:46:46 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright ? 2003 osCommerce Released under the GNU General Public License */ define('NAVBAR_TITLE', 'Login'); define('HEADING_TITLE', 'Welcome, Please Sign In'); define('HEADING_NEW_CUSTOMER', 'New Customer'); define('TEXT_NEW_CUSTOMER', 'I am a new customer.'); define('TEXT_NEW_CUSTOMER_INTRODUCTION', 'By creating an account at ' . STORE_NAME . ' you will be able to shop faster, be up to date on an orders status, and keep track of the orders you have previously made.'); define('HEADING_RETURNING_CUSTOMER', 'Returning Customer'); define('TEXT_RETURNING_CUSTOMER', 'I am a returning customer.'); define('TEXT_PASSWORD_FORGOTTEN', 'Password forgotten? Click here.'); define('TEXT_LOGIN_ERROR', 'Error: No match for E-Mail Address and/or Password.'); define('TEXT_VISITORS_CART', 'Note: Your "Visitors Cart" contents will be merged with your "Members Cart" contents once you have logged on. [More Info]'); ?> Fatal error: Cannot redeclare tep_db_connect() (previously declared in /home/custompo/public_html/store/catalog/includes/functions/database.php:13) in /home/custompo/public_html/store/catalog/includes/functions/database.php on line 13 ===========Above is the error I get when you try to log in as a returning customer...========== Someone please help... this is for my Web Developent final that is due on MONDAY! I'd like to have my page up and running tonight so that I know everything is working. SITE: https://st16.startlogic.com/~custompo/store/catalog/ Here is the code from database.php: ========================================== <?php /* $Id: database.php,v 1.21 2003/06/09 21:21:59 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright © 2003 osCommerce Released under the GNU General Public License */ function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') { global $$link; if (USE_PCONNECT == 'true') { $$link = mysql_pconnect($server, $username, $password); } else { $$link = mysql_connect($server, $username, $password); } if ($$link) mysql_select_db($database); return $$link; } function tep_db_close($link = 'db_link') { global $$link; return mysql_close($$link); } function tep_db_error($query, $errno, $error) { die('<font color="#000000"><B>' . $errno . ' - ' . $error . '<BR><BR>' . $query . '<BR><BR><SMALL><FONT color=#ff0000>[TEP STOP]</FONT></SMALL><BR><BR></B></FONT>'); } function tep_db_query($query, $link = 'db_link') { global $$link; if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { error_log('QUERY ' . $query . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); } $result = mysql_query($query, $$link) or tep_db_error($query, mysql_errno(), mysql_error()); if (defined('STORE_DB_TRANSACTIONS') && (STORE_DB_TRANSACTIONS == 'true')) { $result_error = mysql_error(); error_log('RESULT ' . $result . ' ' . $result_error . "\n", 3, STORE_PAGE_PARSE_TIME_LOG); } return $result; } function tep_db_perform($table, $data, $action = 'insert', $parameters = '', $link = 'db_link') { reset($data); if ($action == 'insert') { $query = 'insert into ' . $table . ' ('; while (list($columns, ) = each($data)) { $query .= $columns . ', '; } $query = substr($query, 0, -2) . ') values ('; reset($data); while (list(, $value) = each($data)) { switch ((string)$value) { case 'now()': $query .= 'now(), '; break; case 'null': $query .= 'null, '; break; default: $query .= '\'' . tep_db_input($value) . '\', '; break; } } $query = substr($query, 0, -2) . ')'; } elseif ($action == 'update') { $query = 'update ' . $table . ' set '; while (list($columns, $value) = each($data)) { switch ((string)$value) { case 'now()': $query .= $columns . ' = now(), '; break; case 'null': $query .= $columns .= ' = null, '; break; default: $query .= $columns . ' = \'' . tep_db_input($value) . '\', '; break; } } $query = substr($query, 0, -2) . ' where ' . $parameters; } return tep_db_query($query, $link); } function tep_db_fetch_array($db_query) { return mysql_fetch_array($db_query, MYSQL_ASSOC); } function tep_db_num_rows($db_query) { return mysql_num_rows($db_query); } function tep_db_data_seek($db_query, $row_number) { return mysql_data_seek($db_query, $row_number); } function tep_db_insert_id() { return mysql_insert_id(); } function tep_db_free_result($db_query) { return mysql_free_result($db_query); } function tep_db_fetch_fields($db_query) { return mysql_fetch_field($db_query); } function tep_db_output($string) { return htmlspecialchars($string); } function tep_db_input($string, $link = 'db_link') { global $$link; if (function_exists('mysql_real_escape_string')) { return mysql_real_escape_string($string, $$link); } elseif (function_exists('mysql_escape_string')) { return mysql_escape_string($string); } return addslashes($string); } function tep_db_prepare_input($string) { if (is_string($string)) { return trim(tep_sanitize_string(stripslashes($string))); } elseif (is_array($string)) { reset($string); while (list($key, $value) = each($string)) { $string[$key] = tep_db_prepare_input($value); } return $string; } else { return $string; } } ?>
♥Vger Posted April 28, 2006 Posted April 28, 2006 The error has nothing to do with database.php, but is to do with the login files, the one in the root and the one in includes/languages/english/ It looks as though you have loaded the includes/languages/english/ login file into the root and overwritten the one that should be there. Vger
custompony Posted April 28, 2006 Author Posted April 28, 2006 The error has nothing to do with database.php, but is to do with the login files, the one in the root and the one in includes/languages/english/ It looks as though you have loaded the includes/languages/english/ login file into the root and overwritten the one that should be there. Vger Is there a way to fix this?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.