Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Parse Error


Joni

Recommended Posts

Very new to this - My very first attempt at amending a few lines in: /includes/languages/english/index.php and now main display page shows Parse error: "parse error, unexpected T_STRING in /data/members/..............htdocs/www/includes/languages/english/index.php on line 13". (where ......... relates to my site).

 

Before altering anything, I made a backup and also block copied the whole of the text in index.php into Word before making any changes, so that I would be able to block copy it back if anything went wrong. Since tried restoring and also block copying the entire original text file back into the index.php file but nothing worked and I still get the same Parse error.

 

Having printed off the front page display before amending anything, I see a reference to: includes/application_top.php file, which happens to be in line 13, where the parse error appears to be. Afraid now to change any settings in this file as suggested on the original display in case anything else goes wrong.

 

Can anyone help please????? :angry:

Link to comment
Share on other sites

Post a copy of your index.php here. It'll be much easier to read if you enclose it in code brackets.

 

-jared

Link to comment
Share on other sites

Post a copy of your index.php here.  It'll be much easier to read if you enclose it in code brackets.

 

-jared

 

Thanks for replying so quickly.

 

This is my index.php copy:

 

($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 © 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

So much for code brackets. :)

 

This:

 define('HEADING_TITLE', 'Let's See What We Have Here');

should be this:

 define('HEADING_TITLE', 'Let\'s See What We Have Here');

 

This:

 define('HEADING_TITLE', 'What's New Here?');

should be this:

 define('HEADING_TITLE', 'What\'s New Here?');

 

This:

 define('TEXT_BUY', 'Buy 1 '');

should be this:

 define('TEXT_BUY', 'Buy 1 ');

 

This:

 define('TEXT_NOW', '' now');

should be this:

 define('TEXT_NOW', ' now');

 

2 basic rules:

1) apostrophes need to be escaped (see first fix above)

2) basic format is this: define ('LABEL', 'text or html'); Note the number and placement of quotes.

 

Try that.

 

-jared

Link to comment
Share on other sites

So much for code brackets.  :)

 

This: 

 define('HEADING_TITLE', 'Let's See What We Have Here');

should be this: 

 define('HEADING_TITLE', 'Let\'s See What We Have Here');

 

This: 

 define('HEADING_TITLE', 'What's New Here?');

should be this: 

 define('HEADING_TITLE', 'What\'s New Here?');

 

This: 

 define('TEXT_BUY', 'Buy 1 '');

should be this: 

 define('TEXT_BUY', 'Buy 1 ');

 

This: 

 define('TEXT_NOW', '' now');

should be this: 

 define('TEXT_NOW', ' now');

 

2 basic rules:

1) apostrophes need to be escaped (see first fix above)

2) basic format is this:  define ('LABEL', 'text or html');  Note the number and placement of quotes.

 

Try that.

 

-jared

Link to comment
Share on other sites

Tried what you suggested but on saving the changes, all amendments default to the original text, so no change. It does state the error is in line 13. Totally confused!

Link to comment
Share on other sites

Unless you mis-quoted your index.php, you're also missing this from the very very top of the file:

<?php
/*

 

Have you tried simply restoring from the default index.php language file?

 

-jared

Link to comment
Share on other sites

Unless you mis-quoted your index.php, you're also missing this from the very very top of the file:

<?php
/*

 

Have you tried simply restoring from the default index.php language file?

 

-jared

 

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

Hi, I would like to join on this....I too have a similar problem

I tried to edit the welcome page.

I edited ....\languages\index.php file. First few lines are shown below. These display perfectly OK.

 

 

<?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 © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

define('TEXT_MAIN', 'Welcome to REAL COMPUTERS ONLINE, <b>Please feel free to browse this for an extensive range of Computer Products, <b>any products purchased will not be delivered nor will the customer be billed</b>.

 

 

When I add just one extra word (website), I get the parse error, unexpected T_STRING .... on line 13

(below is the code with one extra word)

 

<?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 © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

define('TEXT_MAIN', 'Welcome to REAL COMPUTERS ONLINE, <b>Please feel free to browse this website for an extensive range of Computer Products, <b>any products purchased will not be delivered nor will the customer be billed</b>.

 

 

The rest of the code is untouched.

Removing the word does not recover, I have reload the backup copy.

 

 

Tasawer

Link to comment
Share on other sites

define('TEXT_MAIN', 'Welcome to REAL COMPUTERS ONLINE, <b>Please feel free to browse this website for an extensive range of Computer Products, <b>any products purchased will not be delivered nor will the customer be billed</b>.

 

should be

 

define('TEXT_MAIN', 'Welcome to REAL COMPUTERS ONLINE, <b>Please feel free to browse this website for an extensive range of Computer Products, <b>any products purchased will not be delivered nor will the customer be billed</b>.');

 

-jared

Link to comment
Share on other sites

Unless you mis-quoted your index.php, you're also missing this from the very very top of the file:

<?php
/*

 

Have you tried simply restoring from the default index.php language file?

 

-jared

 

Yes, just checked and this code is included but still nothing works. Tried restoring backup but that seems unwilling to comply also. Also just tried block copying your reply to Tasawer with extra brackets added to his new text. Still doesn't work but the error message is now slightly different in that it is missing the UNEXPECTED T_STRING part.

 

Joan

Link to comment
Share on other sites

Someone should have just said in this thread that you DO NOT use the osCommerce File Manager to edit files. It causes parse errors - as you've all found out.

 

Read the post, the link for which is "Psst?? Got a parse error??" below my name. That'll tell you how to edit files properly, but don't forget Jared's advice about 'escaping' apostrophies in text with a preceeding backslash, as in:

 

Let's = wrong

Let\'s = right

 

Vger

Link to comment
Share on other sites

I have tried everything suggested, in addition I have uninstalled/deleted and reinstalled 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 Welcome Page displayed correctly again and I edited 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 isn't restoring 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

:D My grateful thanks to the Vger - After repeatedly removing and re-insalling osCommerce, I have finally succeeded in amending some text on the first page. The fault was obviously caused by editing within osCommerce File Manager. I have since learned a bit more about downloading/uploading and editing with Notepad and it has worked, What's the point of having an editor within osCommerce File Manager if it doesn't work? Thanks again.

Link to comment
Share on other sites

Sorry about the File Manager. We've all been there. :(

 

Try a context-sensitive editor like Crimson Editor, Context, PSPad, etc. You'll appreciate things like PHP syntax-highlighting and automatic bracket matching.

 

-jared

Link to comment
Share on other sites

Sorry about the File Manager.  We've all been there.  :(

 

Try a context-sensitive editor like Crimson Editor, Context, PSPad, etc.  You'll appreciate things like PHP syntax-highlighting and automatic bracket matching.

 

-jared

 

 

Thanks very much for your contribution to my problems. Having sorted this one, I'm sure I'll be back for more help very shortly!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...