Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Accidentally deleted catalog/index.php


pepsican

Recommended Posts

I downloaded oscommerce a week ago and have been busy trying to customize it, and everything was going along swimmingly until tonight when I was making changes to the languages/english/index.php file, and I accidentally uploaded it to the catalalog/index.php folder instead - effectively overwriting my store home page. (I hadn't backed up that particular file because I just installed oscommerce a week ago and I wasn't working on the catalog/index.php file - I was just tired and didn't notice I was uploading to the wrong folder)

 

Now when I go to the homepage of my store, it just comes up blank.

 

I tried to re-upload just the catalog/index.php file from the zip file that came with the download, but that didn't work (store homepage is still blank). I've searched the forums, but can't find anyone else whose had a similar problem. I don't want to undo all the customization work I've done so far by having to reinstall everything, so I'm hoping there's an easier solution I'm just not aware of.

 

Any help you all can provide would be most gratefully received!!

Link to comment
Share on other sites

did you also remember to upload the languages/english/index.php to the correct location

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Thanks for the suggestions! I did indeed upload the new english/index.php file; I think that's working just fine (since I only made a small cosmetic change to some text).

 

I did what you suggested and deleted the catalog/index.php page and re-uploaded the one from the install zip file, and I got this error message when I went to my store homepage:

 

Fatal error: Cannot redeclare tep_db_connect() (previously declared in /public_html/catalog/includes/functions/database.php:13) in /public_html/catalog/includes/functions/database.php on line 13

 

Any ideas what I can do to fix that?

 

Thanks SO much for the assistance!!

Link to comment
Share on other sites

had you made any contribution additions which had you change the index.php?

are you sure you uploaded the correct file? and when you work on the files locally, dont you have those stored so you can upload to the site after you make changes?

Link to comment
Share on other sites

I have installed a few contributions (wishlist, category drop-down box, etc.) but as best as I can remember, none of them required me to modify the catalog/index.php page; I've been re-reading the installation requirements this morning to double check, but don't see any so far.

 

(and yes, I have been backing up my originals before doing any contributions, but as far as I can tell, there haven't been any catalog/index.php ones yet)

 

If it helps, here's line 13 on the database.php file the error references:

 

function tep_db_connect($server = DB_SERVER, $username = DB_SERVER_USERNAME, $password = DB_SERVER_PASSWORD, $database = DB_DATABASE, $link = 'db_link') {

Link to comment
Share on other sites

You have a file that is trying to redeclare the function tep_db_connect this function is normally only declared in the catalog/includes/functions/database.php in a default install, so search your files using

 

function tep_db_connect

 

to see where this function is being declared

a contribution may have added this to general.php or applications_top.php

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

I found these lines in application_top.php:

 

// make a connection to the database... now

? tep_db_connect() or die('Unable to connect to database server!');

 

// set the application parameters

? $configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);

? while ($configuration = tep_db_fetch_array($configuration_query)) {

? ? define($configuration['cfgKey'], $configuration['cfgValue']);

? }

 

I tried deleting these lines and re-uploading application_top.php, but that didn't work, nor did deleting the" function tep_db_connect" line of code on database.php. Any suggestions?

Link to comment
Share on other sites

it would have to have the code

 

function tep_db_connect

 

not just

 

tep_db_connect

 

as

tep_db_connect
is the call to the function whereas
function tep_db_connect
is defining the function

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Thanks for the clarification Steve - I've downloaded an exact copy of all my files on the server and searched through most of them them and can't find any other files besides database.php that have that "function tep_db_connect" line.

 

I am having to open the files manually and then do a controlF search, however, since for some reason when I try to search through all the files in an automated fashion through the Windows Explorer search function, it comes up empty. So perhaps I've missed one, but I have looked in any file that I've touched since I installed the thing, and there don't appear to be any others that include "function tep_db_connect".

 

Could it be something else? Or a slightly modified version of that code?

Link to comment
Share on other sites

I have now searched every single file in my directory, and not a single one besides database.php has the line "function tep_db_connect" so that cannot be the problem.

 

I'm coming to the sad conclusion that I'm going to have to reinstall the entire store, and lose all the work I've done in the last week, because there doesn't appear to be any way to fix this. If I don't hear otherwise from anyone in the next few hours, I'll start over.

 

Thanks anyway to those of you who tried to help...

Link to comment
Share on other sites

from the error

 

database.php is being included 2 time, thus your getting the error

 

their is only one instance, in line 13, but if you look at the error message it is telling you where the First "connect" function was called and where the second is trying to be called, in this case they are in the SAME location

 

which means your calling that file 2 times

Link to comment
Share on other sites

Thanks Mike, but I already re-installed the site, and discovered in the process that it was the english/index.php page that was causing the problem. I don't know what was on it that was calling the database twice (there was no "function tep_db_connect" code) but at least it's fixed now.

 

Thanks anyway to all of you who offered suggestions!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...