Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please help.....parse error


Guest

Recommended Posts

I am new to osCommerce and was directed to the document OscCustomize, after reading it several times I went to the following instruction (something that looked simple):

 

includes/languages/english.php or

appropriate language define('PAGE_TITLE' - this is what will appear in the title bar of all screens, and Last line: define('FOOTER_TEXT_BODY' you may want to include your own copyright information

 

 

I went to the english.php changed the name "osCommerce" to my site name. I clicked on save and then tried to go back to catalog/admin and get the following error:

Parse error: parse error, unexpected T_STRING in /var/www/html/catalog/admin/includes/languages/english.php on line 108

 

The line # I changed was 48. Line 108 says the following:

define('BOX_NOTIFICATIONS_NOTIFY', 'Notify me of updates to <b>%s</b>');

 

As I said earlier I am new and very confused by this. Can someone please help me understand what happened and what I need to do to correct it as I can not even get into catalog/admin now.

 

Thanks in advance

Bruce

Link to comment
Share on other sites

I am new to osCommerce and was directed to the document OscCustomize, after reading it several times I went to the following instruction (something that looked simple):

 

includes/languages/english.php or

appropriate language  define('PAGE_TITLE' - this is what will appear in the title bar of all screens, and Last line: define('FOOTER_TEXT_BODY' you may want to include your own copyright information

I went to the english.php changed the name "osCommerce" to my site name. I clicked on save and then tried to go back to catalog/admin and get the following error:

Parse error: parse error, unexpected T_STRING in /var/www/html/catalog/admin/includes/languages/english.php on line 108

 

The line # I changed was 48. Line 108 says the following:

define('BOX_NOTIFICATIONS_NOTIFY', 'Notify me of updates to <b>%s</b>');

 

As I said earlier I am new and very confused by this. Can someone please help me understand what happened and what I need to do to correct it as I can not even get into catalog/admin now.

 

Thanks in advance

Bruce

 

Go back to whatever you changed and look for ' (apostrophes) and " (Quotes) etc that you have not coded correctly for php. Remove these.

 

Charles

A kite flies highest AGAINST the wind !

 

"Life should NOT be a journey to the grave with the intention of arriving safely in an attractive and well preserved body, but rather to skid in sideways, a lover in one hand, martini in the other, body thoroughly used up, totally worn out and screaming ~ WOO HOO!! What a ride!"

Link to comment
Share on other sites

Go back to whatever you changed and look for ' (apostrophes) and " (Quotes)  etc that you have not coded correctly for php. Remove these.

 

Charles

 

 

CharlesThanks for your suggestion. Unfortunately it didn't help. Here is exactly what I did.

 

Last night, I changed this:

 

// page title

define('TITLE', 'osCommerce');

 

to

 

// page title

define('TITLE', 'Always Leather');

 

After your suggestion I changed this:

 

// page title

define('TITLE', 'Always Leather');

 

to

 

// page title

define('TITLE', Always Leather);

 

 

I am still getting the same error:

 

 

Parse error: parse error, unexpected T_STRING in /var/www/html/catalog/admin/includes/languages/english.php on line 108

 

 

Bruce

Link to comment
Share on other sites

The simple explanation!

 

Don't use the osCommerce File Manager to edit files. When you hit the 'Save' button it uses a php command called 'strip slashes' and strips out essential backlsashes from in front of apostrophies in text. This causes 'Parse Errors'.

 

Download the file to be edited, take a backup (just in case) and edit in a plain text editor like Notepad - not Word or Wordpad as they're NOT plain text editors. Once edited upload again, and if you have any problems you can always restore from the backup you took.

 

When adding text to a page content file and you use an apostrophy, always precede the apostrophy with a backslash, as in:

 

Let's = wrong

Let\'s=right

 

I suggest you restore the messed up file from a good original copy, and then start again.

 

Vger

Link to comment
Share on other sites

PHP is telling you it cannot separate out syntax now. In other words, if you leave something like a ; off the end of a PHP statement it will not know where to end the statement or tell one statement from another. There are many, many little syntax glitches that always hang up programmers. Another one is if you start a string with " or ' and do not end the string with a similar quote, then it gives a parse error. Or else you do not escape a ' in the middle of a string and it thinks that the ' ends the string and then gets confused by the ' where you thought you were ending the string. It goes on and on. I code PHP a lot, and usually get parse errors whenever I make any substantial changes just from typos.

 

I cannot see the parse error from what you have showed here. What you need to do is somehow revert to the php files that you had before you changed them. Always make sure that you can do this before you make changes to files. I always just make a copy of the PHP file that I am changing and call it xxx_old.php or something like that. Then I can always go back if I need to. I also make frequent backups of my whole site.

 

Then, after reverting, make one tiny, incremental change at a time and make sure that there are no typos at all. If you divide up the changes into small bits, and you do get a parse error, you will probably find the typo.

 

I also just use a text editor (or an IDE), rather than the osCommerce editing tools.

 

Even if you solve your immediate problem quickly, you will save yourself a lot of headaches following this in the future.

Thanks,

 

David Watson

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...