Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

accidentally overwrote index.php


comet

Recommended Posts

Posted

Hi there, I totally noobed out today, and wanted to make a minor change to the index.php in the TEXT_MAIN section..

 

without really thinking, I found an old version of index.php locally stored on my computer.. I proceeded to edit the file, since I edited it months ago before I added any items or configured the catalog.. now, months later, I make a few small changes in the TEXT_MAIN area, just specifying our refund policy, re-upload the file through FTP, using ASCII mode, and setting the right permissions, and my whole catalog comes up completely blank.

 

since I use a webhosting company that controls the php server, I had to get an admin to send me what was displaying in the error log.. and here's what it is:

 

Notice: Undefined variable: category_depth in c:\hosting\webhost4life\member\cardscomp\peekaboo\catalog\index.php on line 18

Notice: Undefined variable: category_depth in c:\hosting\webhost4life\member\cardscomp\peekaboo\catalog\index.php on line 36

Notice: Undefined variable: category_depth in c:\hosting\webhost4life\member\cardscomp\peekaboo\catalog\index.php on line 38

 

 

obviously its looking for a variable called category_depth.. I have no clue what that is, or where its located.. i'm by no means a code expert, and I pretty much had the admins to install osCommerce for me automatically.. here is the index.php file I uploaded..

 

<?php
/*
 $Id: index.php,v 1.1 2003/06/11 17:38:00 hpdl Exp $

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

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/


}


define('TEXT_MAIN', '<p><font face="Verdana" size="2"><b>Thanks for visiting The Peekaboo Toys and Kites Online Store!</p><p>Please browse around by clicking on the different categories. </font></p><p><font face="Verdana" size="2">If you have questions or comments, please go to our <a href="contact.html">contact</a> page. </b></font></p><font face="Verdana" size="2"><b>If you are dissatisfied in any way please return your item for a refund</p><font face="Verdana" size="2"><b>Shipping fees are non-refundable.</p> ');
define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');
define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');
define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
 define('HEADING_TITLE', 'Let\'s See What We Have Here');
 define('TABLE_HEADING_IMAGE', '');
 define('TABLE_HEADING_MODEL', 'Model');
 define('TABLE_HEADING_PRODUCTS', 'Product Name');
 define('TABLE_HEADING_MANUFACTURER', 'Manufacturer');
 define('TABLE_HEADING_QUANTITY', 'Quantity');
 define('TABLE_HEADING_PRICE', 'Price');
 define('TABLE_HEADING_WEIGHT', 'Weight');
 define('TABLE_HEADING_BUY_NOW', 'Buy Now');
 define('TEXT_NO_PRODUCTS', 'There are no products to list in this category.');
 define('TEXT_NO_PRODUCTS2', 'There is no product available from this manufacturer.');
 define('TEXT_NUMBER_OF_PRODUCTS', 'Number of Products: ');
 define('TEXT_SHOW', '<b>Show:</b>');
 define('TEXT_BUY', 'Buy 1 \'');
 define('TEXT_NOW', '\' now');
 define('TEXT_ALL_CATEGORIES', 'All Categories');
 define('TEXT_ALL_MANUFACTURERS', 'All Manufacturers');
} elseif ($category_depth == 'top') {
 define('HEADING_TITLE', 'What\'s New Here?');
} elseif ($category_depth == 'nested') {
 define('HEADING_TITLE', 'Categories');
}
?>

 

 

i have a feeling I overwrote and replaced some serious stuff.. i have no clue how to get it back.. the catalog has over 300 items in it, so I just hope to God that I won't have to re-install.. Thanks for your help guys..

Posted

I copied your code and placed it in my index and all seems to work fine so my guest is that the problem is in your english.php

 

hope you find your problem I have not enough info to help you sorry good luck

Posted

i looked at my english.php file.. and thats been untouched entirely.. it looks like a foreign language to me unfortunately.. this is mind boggling

Posted

ok so well , are you sure that your index file is in the right place cause I put accidently my index file in the wrong place once and me too had a blank page so I put the file say in my catalog/include/languages/english/index and all was ok

 

good luck again

Posted
ok so well , are you sure that your index file is in the right place cause I put accidently my index file in the wrong place once and me too had a blank page so I put the file say in my catalog/include/languages/english/index and all was ok

 

good luck again

 

 

thats exactly it.. I accidentally replaced the index.php file that was in the catalog root directory.. what really needs to be there??

Posted

FIXED IT!!! I simply downloaded oscommerce again, and used the default catalog/index.php.... i totally overwrote that file thinking that it was teh english/index.php... this fixed the problem!! PRAISE THE LORD!!! OH HAPPY DAY!!

Posted
FIXED IT!!! I simply downloaded oscommerce again, and used the default catalog/index.php.... i totally overwrote that file thinking that it was teh english/index.php... this fixed the problem!! PRAISE THE LORD!!! OH HAPPY DAY!!

 

Backup database and files before making changes.

Backup before making changes. Backup before making changes! Backup before making changes!!

 

You did do a backup? eh?

Archived

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

×
×
  • Create New...