Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Index.php


Guest

Recommended Posts

Setting up for first time. Is there any easy way of removing the text from the main page without trawling through the index.php file with a text editor? I keep getting error messages because presumably I am removing certain tags that are needed.

Link to comment
Share on other sites

No, you'll need to make the changes with your text editor. Welcome to the wonderful world of programming.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

1. Download the file to be edited (preferably by FTP)

2. Take a backup (just in case)

3. Edit the file you downloaded with a plain text editor like Notepad, Text Pad or Crimson Editor (not Word, Wordpad etc. they are not plain text editors)

4. Upload the file once edited.

5. If there are any problems then restore from the backup you made.

6. Escape all apostrophies in text with a preceeding backslash (to prevent parse errors) e.g.

 

Let's = wrong

Let\'s = right

 

Vger

Link to comment
Share on other sites

  • 2 weeks later...

Now I'm getting this:what do i do?

Fatal error: Call to undefined function: tep_image() in /home/u2/thebuggy/html/osc/index.php on line 13

 

 

my index.php

 

<?php

/*

$Id: index.php,v 1.1.1.1 2005/03/14 17:14:38 andrei Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

define('TEXT_MAIN', 'This is a default setup of the osCommerce project, products shown are for demonstrational purposes, <b>any products purchased will not be delivered nor will the customer be billed</b>. Any information seen on these products is to be treated as fictional.<br><br><table border="0" width="100%" cellspacing="5" cellpadding="2"><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/1.gif') . '</td><td class="main" valign="top"><b>Error Messages</b><br><br>If there are any error or warning messages shown above, please correct them first before proceeding.<br><br>Error messages are displayed at the very top of the page with a complete <span class="messageStackError">background</span> color.<br><br>Several checks are performed to ensure a healthy setup of your online store - these checks can be disabled by editing the appropriate parameters at the bottom of the includes/application_top.php file.</td></tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/2.gif') . '</td><td class="main" valign="top"><b>Editing Page Texts</b><br><br>The text shown here can be modified in the following file, on each language basis:<br><br><nobr class="messageStackSuccess">[path to catalog]/includes/languages/' . $language . '/' . FILENAME_DEFAULT . '</nobr><br><br>That file can be edited manually, or via the Administration Tool with the <nobr class="messageStackSuccess">Languages->' . ucfirst($language) . '->Define</nobr> or <nobr class="messageStackSuccess">Tools->File Manager</nobr> modules.<br><br>The text is set in the following manner:<br><br><nobr>define('TEXT_MAIN', '<span class="messageStackSuccess">This is a default setup of the osCommerce project...</span>');</nobr><br><br>The text highlighted in green may be modified - it is important to keep the define() of the TEXT_MAIN keyword. To remove the text for TEXT_MAIN completely, the following example is used where only two single quote characters exist:<br><br><nobr>define('TEXT_MAIN', '');</nobr><br><br>More information concerning the PHP define() function can be read <a href="http://www.php.net/define" target="_blank"><u>here</u></a>.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/3.gif') . '</td><td class="main" valign="top"><b>Securing The Administration Tool</b><br><br>It is important to secure the Administration Tool as there is currently no security implementation available.</td></tr><tr><td class="main" valign="top">' . tep_image(DIR_WS_IMAGES . 'default/4.gif') . '</td><td class="main" valign="top"><b>Online Documentation</b><br><br>Online documentation can be read at the <a href="http://wiki.oscommerce.com" target="_blank"><u>osCommerce Wiki Documentation Effort</u></a> site.<br><br>Community support is available at the <a href="http://www.oscommerce.com/forums" target="_blank"><u>osCommerce Community Support Forums</u></a> site.</td></tr></table><br>If you wish to download the solution powering this shop, or if you wish to contribute to the osCommerce project, please visit the <a href="http://www.oscommerce.com" target="_blank"><u>support site of osCommerce</u></a>. This shop is running on osCommerce version <font color="#f0000"><b>' . PROJECT_VERSION . '</b></font>.');

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');

}

?>

Link to comment
Share on other sites

  • 2 weeks later...

I am having a similar problem, i remove all the text from TEXT_MAIN ie:

define('TEXT_MAIN', '');

define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

i get the following error:

Parse error: parse error, unexpected T_STRING in /home/gaian/public_html/shop/includes/languages/english/index.php on line 19

 

i see nothing wrong with line 19, and i never edited it.

Link to comment
Share on other sites

I am having a similar problem, i remove all the text from TEXT_MAIN ie:

define('TEXT_MAIN', '');

define('TABLE_HEADING_NEW_PRODUCTS', 'New Products For %s');

define('TABLE_HEADING_UPCOMING_PRODUCTS', 'Upcoming Products');

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

i get the following error:

Parse error: parse error, unexpected T_STRING in /home/gaian/public_html/shop/includes/languages/english/index.php on line 19

 

i see nothing wrong with line 19, and i never edited it.

 

/includes/languages/english/index.php

 

define('TEXT_MAIN', '');

 

Another way to remove the default text is to edit the index.php in your catalog folder and simply remove the tag

 

<?php echo TEXT_MAIN; ?>.

 

On another note, the easiest way that I have found to place text and pictures here is to create an html page or php page and include it at this point with

 

<?php include "text_main.htm"; ?>

 

You can name the page whatever you like. In some situations you may want to use an absolute reference to include the page. If you do that and it is an html page it doesn't even have to be on the same server!

 

<?php include "http://remoteserversomewhereorother.com/text_main.htm"; ?>

 

B)

Link to comment
Share on other sites

Comforting to know I'm not the only one having problems. I have now tried everything suggested, in addition I have uninstalled/deleted osCommerce three times. On the first attempt, the Welcome Page was displayed, so I tried editing the index.php file once by editing with Notepad and on the second occasion editing through File Manager within osCommerce. Being cautious, I made an amendment replacing just the osCommerce wording in the Welcome Page with my business name, All Things Natural. I got the same error message every time. In addition, my restore won't work either. I'm running Windows XP, don't know if this is relevant. Don't know where to go from here.

Link to comment
Share on other sites

Comforting to know I'm not the only one having problems.  I have now tried everything suggested, in addition I have uninstalled/deleted osCommerce three times.  On the first attempt, the Welcome Page was displayed, so I tried editing the index.php file once by editing with Notepad and on the second occasion editing through File Manager within osCommerce.  Being cautious, I made an amendment replacing just the osCommerce wording in the Welcome Page with my business name, All Things Natural.  I got the same error message every time.  In addition, my restore won't work either.  I'm running Windows XP, don't know if this is relevant.  Don't know where to go from here.

 

The problem (i believe) can have only been caused by one of two things.

 

1. Another file has been edited.

2. Your backup file has been edited and saved and the point after an error.

 

If you dont have a fresh backup of the file i suggest:

Downloading the osCommerce file from oscommerce.com (always keep this download safe and NEVER edit any of the files, just copy them and then edit the noew copy.

This is how i work, so i can always go back in time.

 

I know it is easy to sometimes get carried away by keep editing, updating, edit more, update more then think Ah i need to back up. But it really cant be understated how much you need to create a backup.

 

Anyway:

I keep hearing most people running on about using notepad and such like to edit the PHP files.

This is great if it is your only option.

However here is what i do and what i can achieve.

Apart from using FrontPage to edit some files and load them to my server, when i need to make large structual adjustments to a page i open the file in Dreamweaver.

This allows me to look at the table that the PHP file has coded into it.

Its does not look exactly like it would when displayed on the web or server but it is easy enough to soon work out which Table Cells hold what.

You originally asked how to remove the text displayed in the index.php

For this i used Dreamweaver, found the relevant Table Cell and just deleted the whole Cell. I also did the same with the Cells above that text, The welcome text and then the What's New, Images Displayed (some required extra files to be edited).

This has effected my front page now and made things shift up and be where i want them.

The extra added bonus (A BIG ONE in my opinion) is that using Dreamweaver (or like programs) is that is displays line numbers (have you ever tried counting lines in notepad) so when an error is displayed with a line number i can jump straight to that line. The error normal shows 'expected or unexpected' (something here)

I then look hard at the line and try and see where the 'expected or unexpected' item shoul/shouldnt be.

 

So in conclusion several programs can be used for editing PHP files, For me Dreamweaver.

Fresh Backup always on standby.

Try and understand what is going on in the PHP code (structured programming), just getting a rough idea helps you then see where tables, links ect are. Which will give you a rough idea where to add or delete things.

 

----------------------------------------

Im no master (far from it)

So dont qoute me on anything

Unless it was good :D

Link to comment
Share on other sites

Comforting to know I'm not the only one having problems.  I have now tried everything suggested, in addition I have uninstalled/deleted osCommerce three times.  On the first attempt, the Welcome Page was displayed, so I tried editing the index.php file once by editing with Notepad and on the second occasion editing through File Manager within osCommerce.  Being cautious, I made an amendment replacing just the osCommerce wording in the Welcome Page with my business name, All Things Natural.  I got the same error message every time.  In addition, my restore won't work either.  I'm running Windows XP, don't know if this is relevant.  Don't know where to go from here.

 

Please open your catalog/index.php page and do a search in the source code for

<?php echo TEXT_MAIN; ?>

once you find this text delete it. This should be around line 307.

 

This should remove the TEXT_MAIN completely and clear up your errors.

This is the statement that calls the TEXT_MAIN from the languges/english/index.php. Without this statement there is no way the TEXT_MAIN can cause errors.

 

Instead of using File Manager you should use FTP and notepad or download an HTML editor to use.

 

A decent free editor can be downloaded from Nvu that provides an FTP client and editor

 

http://www.nvu.com/

 

Hope this helps.

Link to comment
Share on other sites

The problem (i believe) can have only been caused by one of two things.

 

1. Another file has been edited.

2. Your backup file has been edited and saved and the point after an error.

 

If you dont have a fresh backup of the file i suggest:

Downloading the osCommerce file from oscommerce.com (always keep this download safe and NEVER edit any of the files, just copy them and then edit the noew copy.

This is how i work, so i can always go back in time.

 

I know it is easy to sometimes get carried away by keep editing, updating, edit more, update more then think Ah i need to back up. But it really cant be understated how much you need to create a backup.

 

Anyway:

I keep hearing most people running on about using notepad and such like to edit the PHP files.

This is great if it is your only option.

However here is what i do and what i can achieve.

Apart from using FrontPage to edit some files and load them to my server, when i need to make large structual adjustments to a page i open the file in Dreamweaver.

This allows me to look at the table that the PHP file has coded into it.

Its does not look exactly like it would when displayed on the web or server but it is easy enough to soon work out which Table Cells hold what.

You originally asked how to remove the text displayed in the index.php

For this i used Dreamweaver, found the relevant Table Cell and just deleted the whole Cell. I also did the same with the Cells above that text, The welcome text and then the What's New, Images Displayed (some required extra files to be edited).

This has effected my front page now and made things shift up and be where i want them.

The extra added bonus (A BIG ONE in my opinion) is that using Dreamweaver (or like programs) is that is displays line  numbers (have you ever tried counting lines in notepad) so when an error is displayed with a line number i can jump straight to that line. The error normal shows 'expected or unexpected' (something here)

I then look hard at the line and try and see where the 'expected or unexpected' item shoul/shouldnt be.

 

So in conclusion several programs can be used for editing PHP files, For me Dreamweaver.

Fresh Backup always on standby.

Try and understand what is going on in the PHP code (structured programming), just getting a rough idea helps you then see where tables, links ect are. Which will give you a rough idea where to add or delete things.

 

----------------------------------------

Im no master (far from it)

So dont qoute me on anything

Unless it was good  :D

 

 

I second the vote for Dreamweaver. I have been using DW to edit PHP and manage PHP websites for four years now. If you don't have the 400 bucks or don't want to spend it you can download the free Nvu or try the dreamweaver trial

http://www.macromedia.com/cfusion/tdrc/ind...uct=dreamweaver

Link to comment
Share on other sites

Don't know where to go from here.

 

You should also consider getting yourself a file comparison tool, such as Beyond Compare. When you get an error that is the result of an editing mistake, load up the original file and your modified version in BC. You can compare lines side-by-side, with color coding to highlight the differences.

 

There is a free 30-day trial.

 

http://www.scootersoftware.com/

 

++ Not affiliated with the above-mentioned company. ++

"Buy the ticket, take the ride..." -HST

Link to comment
Share on other sites

when i need to make large structual adjustments to a page i open the file in Dreamweaver.

This allows me to look at the table that the PHP file has coded into it.

Its does not look exactly like it would when displayed on the web or server but it is easy enough to soon work out which Table Cells hold what.

 

The Firefox Browser now has this funcationality for free.

 

When you get an error that is the result of an editing mistake, load up the original file and your modified version in BC. You can compare lines side-by-side, with color coding to highlight the differences.

 

UltraEdit offer this functionality, PLUE sytax highlighting, multi-file open/save/edit/find support, FTP (or SFTP, SSH2, PSCP), code folding, and too much more to list here.

 

UltraEdit also offers a free 45 day trial.

-------------------------------------------------------------------------------------------------------------------------

NOTE: As of Oct 2006, I'm not as active in this forum as I used to be, but I still work with osC quite a bit.

If you have a question about any of my posts here, your best bet is to contact me though either Email or PM in my profile, and I'll be happy to help.

Link to comment
Share on other sites

Talking about editors, why not go for a complete IDE, and a free one even? Checkout Eclipse with the PHPEclipse plug-in, combined with a CVS server. Unbeatable! No need for a separate tool to compare your files, it's all integrated.

 

Warning: prepare to spend some time learning Eclipse, especially if you're not used to other IDEs yet. I'm sure you'll find plenty of info via the Eclipse website.

 

Good luck :)

Link to comment
Share on other sites

This page is full of advice from the blind to the blind. If you don't know the correct answer then please do not offer advice. Like this post:

Another way to remove the default text is to edit the index.php in your catalog folder and simply remove the tag

 

<?php echo TEXT_MAIN; ?>.

 

Yes, that will remove the text from the homepage (by removing all content from the homepage) - along with the 'Welcome' text and 'Login' and 'Create Account' also the 'New Products For' feature and a whole host of other things that are tied into it.

 

The problems that people have had with TEXT_MAIN in includes/languages/english.php are due to two roblems:

 

1. They have been using the osCommerce File Manager to edit files. This uses a php command called 'stripslashes', and it does just that and strips essential backslashes from in front of apostrophies in text resulting in parse errors e.g.

Let's = parse error

Let\'s = no parse error

2. Once you've used the osCommerce File Manager to edit a file and you get an error message - then even if you resolve that one error you'll probably get more error messages, one after the other. Only the first error message is reported at any one time.

 

Follow the link entitled "Psst?? Got a parse error??" below my name for the correct way to edit files in osCommerce.

 

Vger

Link to comment
Share on other sites

This page is full of advice from the blind to the blind.  If you don't know the correct answer then please do not offer advice.  Like this post:

Yes, that will remove the text from the homepage (by removing all content from the homepage) - along with the 'Welcome' text and 'Login' and 'Create Account' also the 'New Products For' feature and a whole host of other things that are tied into it.

 

The problems that people have had with TEXT_MAIN in includes/languages/english.php are due to two roblems:

 

1.  They have been using the osCommerce File Manager to edit files.  This uses a php command called 'stripslashes', and it does just that and strips essential backslashes from in front of apostrophies in text resulting in parse errors e.g.

Let's = parse error

Let\'s = no parse error

2.  Once you've used the osCommerce File Manager to edit a file and you get an error message - then even if you resolve that one error you'll probably get more error messages, one after the other.  Only the first error message is reported at any one time.

 

Follow the link entitled "Psst?? Got a parse error??" below my name for the correct way to edit files in osCommerce.

 

Vger

 

 

Who's blind?

 

Removing the TEXT_MAIN has absolutely no effect on Welcome Text, login and create account which are all separate tags.

 

Welcome text is

 

<?php echo tep_customer_greeting(); ?>

 

The login and create account are not even in the index.php they're in includes/header.php

 

<?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') . '">

 

New products is a separate tag in index.php

 

<?php include(DIR_WS_MODULES . FILENAME_NEW_PRODUCTS); ?>

 

So go ahead and remove <?php echo TEXT_MAIN; ?> and this will have absolutely no effect on other elements in the page. Or replace it with tags from a dozen or so contributions which do just that to populate the page with dynamic text.

Link to comment
Share on other sites

  • 1 month later...

Heres my problem im workin on a fresh install on a test server instead of working on main site pleas tell me what i'm doin wrong i'll be greatfull

 

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /includes/languages/english/index.php on line 14

 

 

 

<?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', 'Welcome to The Jerky Store the one stop shop for all your jerky needs , our aim is to supply you with the best selection of jerky available in the uk', ');
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');
}
?>

Link to comment
Share on other sites

define('TEXT_MAIN', 'Welcome to The Jerky Store the one stop shop for all your jerky needs , our aim is to supply you with the best selection of jerky available in the uk', ');

 

Should look like:

define('TEXT_MAIN', 'Welcome to The Jerky Store the one stop shop for all your jerky needs , our aim is to supply you with the best selection of jerky available in the uk');

 

 

Look at other define statements below and you can see the pattern of define('name', 'definition');

 

--Ryan

Link to comment
Share on other sites

  • 1 month later...
/includes/languages/english/index.php

 

define('TEXT_MAIN', '');

 

Another way to remove the default text is to edit the index.php in your catalog folder and simply remove the tag

 

<?php echo TEXT_MAIN; ?>.

 

On another note, the easiest way that I have found to place text and pictures here is to create an html page or php page and include it at this point with

 

<?php include "text_main.htm"; ?>

 

You can name the page whatever you like. In some situations you may want to use an absolute reference to include the page. If you do that and it is an html page it doesn't even have to be on the same server!

 

<?php include "http://remoteserversomewhereorother.com/text_main.htm"; ?>

 

B)

 

 

/includes/languages/english/index.php

 

define('TEXT_MAIN', '');

 

Another way to remove the default text is to edit the index.php in your catalog folder and simply remove the tag

 

<?php echo TEXT_MAIN; ?>.

 

On another note, the easiest way that I have found to place text and pictures here is to create an html page or php page and include it at this point with

 

<?php include "text_main.htm"; ?>

 

You can name the page whatever you like. In some situations you may want to use an absolute reference to include the page. If you do that and it is an html page it doesn't even have to be on the same server!

 

<?php include "http://remoteserversomewhereorother.com/text_main.htm"; ?>

 

B)

Link to comment
Share on other sites

/includes/languages/english/index.php

 

define('TEXT_MAIN', '');

 

Another way to remove the default text is to edit the index.php in your catalog folder and simply remove the tag

 

<?php echo TEXT_MAIN; ?>.

 

On another note, the easiest way that I have found to place text and pictures here is to create an html page or php page and include it at this point with

 

<?php include "text_main.htm"; ?>

 

You can name the page whatever you like. In some situations you may want to use an absolute reference to include the page. If you do that and it is an html page it doesn't even have to be on the same server!

 

<?php include "http://remoteserversomewhereorother.com/text_main.htm"; ?>

 

B)

 

I like your workaround idea. Nothing else I've tried is working.

 

How would you go about linking an html page into the shipping.php file in catalog/includes/languages/english? I've created an html page and saved it as shipping.html.

 

Then I changed the shipping.php page to:

 

<?php include "shipping.html";

/*

$Id: shipping.php,v 1.4 2002/11/19 01:48:08 dgw_ Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2002 osCommerce

 

Released under the GNU General Public License

*/

 

define('NAVBAR_TITLE', 'Shipping & Returns');

define('HEADING_TITLE', 'Shipping & Returns');define('TEXT_INFORMATION', '.'); ?>

 

____________________

 

(I put the period after TEXT_INFORMATION to see if the page would show up & it did. However, it opened with an error message at the top of the page like the one shown below.)

 

First I tried uploading shipping.html into the english folder alongside shipping.php. I got an eror message similar to the one below when I try to open the page from the Shipping & Returns link on the main index page.

 

Next, I tried uploading the html page directly into the main catalog folder which didn't work either.

 

I got this error at top of page:

 

Warning: main(shipping.html): failed to open stream: No such file or directory in /www/a/agelesspages/htdocs/catalog/includes/languages/english/shipping.php on line 1

 

Warning: main(shipping.html): failed to open stream: No such file or directory in /www/a/agelesspages/htdocs/catalog/includes/languages/english/shipping.php on line 1

 

Warning: main(): Failed opening 'shipping.html' for inclusion (include_path='.:/usr/local/lib/php') in /www/a/agelesspages/htdocs/catalog/includes/languages/english/shipping.php on line 1

_____________________

Link to comment
Share on other sites

I like your workaround idea. Nothing else I've tried is working.

 

How would you go about linking an html page into the shipping.php file in catalog/includes/languages/english? I've created an html page and saved it as shipping.html.

 

.......

 

Warning: main(shipping.html): failed to open stream: No such file or directory in /www/a/agelesspages/htdocs/catalog/includes/languages/english/shipping.php on line 1

 

Warning: main(shipping.html): failed to open stream: No such file or directory in /www/a/agelesspages/htdocs/catalog/includes/languages/english/shipping.php on line 1

 

Warning: main(): Failed opening 'shipping.html' for inclusion (include_path='.:/usr/local/lib/php') in /www/a/agelesspages/htdocs/catalog/includes/languages/english/shipping.php on line 1

_____________________

 

I should have prefaced the above by saying I'd originally been getting the parse error UNEXPECTED T_STRING on both the TEXT_MAIN and the Shipping & Returns pages. I was unable to find why so I looked at what to do as an alternative.

 

I have an old copy of osCommerce that I use as a backup, but someday probably ought to install a fresh copy. Just can't work up the desire to install again. Lots who have seem to just be getting the same problems all over again & burning out even worse.

 

Well, I got the shipping page to work after 3 days, up til 1 AM yesterday. While I edited it in Notepad, I used Wordpad -which is pre-installed on my computer- to look at the document. Wordpad helped me identify what line had the parse error. It was an apostrophe, just as Vger pointed out. Instead of escaping it I simply changed the word "you'd" to "you would".

 

Also, I had to go back over the entire html page which I created in Netscape Composer to paste into shipping.php and use as my Shipping & Returns page. There were some html errors that I fixed. That, and changing the apostrophe did the trick!

 

Thanks to all for your helpful comments!! B)

Link to comment
Share on other sites

  • 1 month later...

I installed OS Commerce yesterday and was in the process of uploading all of my merchandise when I decided to change the demo text that appears with a fresh install. I followed the instructions (or so I thought) and edited index.php in File Manager. Now when I try to go to my site, I get this parse error:

 

Parse error: parse error, unexpected T_STRING in /home/arastore/public_html/includes/languages/english/index.php on line 13

 

I didn't edit line 13, and I don't see anything wrong with it. This is what line 13 looks like:

 

require('includes/application_top.php');

 

How do I fix this error?

Link to comment
Share on other sites

I installed OS Commerce yesterday... edited index.php in File Manager. Now when I try to go to my site, I get this parse error:

 

Parse error: parse error, unexpected T_STRING in /home/arastore/public_html/includes/languages/english/index.php on line 13

 

I didn't edit line 13, and I don't see anything wrong with it. This is what line 13 looks like:

 

require('includes/application_top.php');

 

How do I fix this error?

 

You need to search here for the bug fix in order to use File Manager. Apparently, it causes problems if you try to use it for editing any of your files. I haven't tried it out with the bug fix installed, so can't say how well it does.

 

When I got help for editing, it was recommended by experts that I download the file to be edited to my local computer. Edit with Notepad, not Wordpad. (Use Notepad if it's easier for now, and if you don't have anything better like any of the software recommended in this topic.)

 

Back up your file before you edit so that you can go back in time, just as Martin (bbr- Yoda) says. He is really smart. :thumbsup: -as are many others here. I'm just replying in case you don't get help from anybody else more experienced than me. That can be discouraging when you're just starting.

 

Anyway, save your edited file and upload to your remote site using an FTP client. You can get FileZilla free if you don't have anything else for now.

 

I was also getting that parse error for awhile but can't remember just now how I fixed it. Do a search with that exact phrase and you should be able to find out more.

Link to comment
Share on other sites

  • 1 month later...
1. Download the file to be edited (preferably by FTP)

2. Take a backup (just in case)

3. Edit the file you downloaded with a plain text editor like Notepad, Text Pad or Crimson Editor (not Word, Wordpad etc. they are not plain text editors)

4. Upload the file once edited.

5. If there are any problems then restore from the backup you made.

6. Escape all apostrophies in text with a preceeding backslash (to prevent parse errors) e.g.

 

Let's = wrong

Let\'s = right

 

Vger

 

Hi, I am a new user and have just had my site restored because of this information. Thank you.

 

B.

Link to comment
Share on other sites

  • 1 year later...

I'm a newbie to osCommerce and to php stuff, and was having the same sorts of problems with parse errors and other errors that people here are having. I finally got it back to the way it was and I believe I've figured out how to put text in to replace what's there now. So I thought I'd go through it as step-by-step as possible in case others are having trouble.

I haven't tried deleting the text_main from the /catalog/index.php and the /english/index.php so I won't talk about that.

 

1. I followed the instructions on the front page for editing its content using File Manager in osCommerce. Since I had no idea what I was doing, I decided to be cautious and simply replace the opening couple of sentences after text_main just to see how it came out. I got a parse error. I came to this site and looked around and found where someone had put up the index.php of their own site, so i tried that, but it didn't work either: I got a new error, which I don't remember now. I got new errors and new variations on errors as i tried new things. Unfortunately I hadn't made a backup. But I had opened a backup file manager window with the unedited (I think!) index.php on it. So I gave up experimenting and tried to save the unedited(?) one over the one I had just done. Still didn't work. I think this must have to do with what someone on this thread said about file manager taking out slashes.

 

2. After reading this thread I downloaded osCommerce (http://www.oscommerce.com/solutions/downloads) and used Fetch (I'm on a Mac--Fetch is just a simple FTP program) to upload /english/index.php (and /catalog/index.php for good measure -- i also put my image settings (under configuration>images in the admin tool) back to width 100, height 80 (I had taken out 80 and replaced with nothing so that tall images wouldn't be squashed--worked, but i wasn't sure if it might be causing problems)). I'm not sure which of these, or a combination of these things worked, but something worked, because now it was back to the way it was.

 

3. So now I started experimenting, trying to figure out where it got messed up. I backed up my newly downloaded /english/index.php and opened it with textedit. I took out the sentences after text_main, replaced with "test" and uploaded. It worked. So I got bolder: "This is a test sentence with a period." That worked too. So I tried: "This sentence isn't very long." And I got a parse error. Ahah! It WAS the apostrophes. So I tried the fix I remembered from this thread of placing \ in front of apostrophes, and it worked (actually it didn't work the first time, because i was using / instead of \ --but now i know better.) So I tried multiple sentences with apostrophes and question marks and exclamation points, and it seems to be working fine.

 

So anyway, that's my long way of saying that Vger's solution above works: download oscommerce, replace your messed up files with fresh ones and then: A. Don\'t use File Manager. B. Don\'t use apostrophes unless you put a "\" in front of them.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...