Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Altering index.php has made my shop vanish!


gjindancer

Recommended Posts

Posted

Hi Everyone!

 

I was attempting to add some content on the front page of my shop - first in the admin section. When trying to cut and paste html into the text area, as soon as I saved it - my shopfront went blank!!

 

Fortunately I could go back and take out all the HTML, save and my shopfront would appear again!

 

I assumed this was some artifacts in the HTML not being compatible, so I attempted typing text then saving, using <BR> then saving etc... experimenting with what would work..

 

Whatever it was that caused my front page to dissapear - I could always bring the shopfront back by deleting all I had entered, or cut and pasted..

 

Still confused, I looked around this forum, and heard the admin editor was a dodgy to use, so I edited the index.php file in dreamweaver..

 

My shop dissapeared again, but this time I cannot get it back!! The whole screen is blank!!

 

I put the index.php file back the way it was in dreamweaver, saved it back to includes/languages/english - yet my shop is still now blank!!

 

I checked back into the admin editor and the index.php file looks as it did originally, but saving this does not get my shop to reappear!!

 

Help!

Posted

Well I downloaded the zip files again for oscommerce and re-uploaded the index.php file and my shops there again..

 

www.radecal.net/webshop/

 

I panicked a bit :D

 

Is it possible to use tables and images within the index.php file though?

 

I read on the forum that any instance of " needs to be prefixed with a \ so the " won't confuse the code,

could anyone give me an example of what this should look like??

 

Thanks!!

Posted

Yes you can put any html code into index.php. BE CAREFUL though you are offering a choice of languages and anything you put into /catalog/index.php will not change when a new language is selected. If you wish to use language specific stuff edit /catalog/inlcudes/languages/[language_of_choice]/index.php. You can put html in here as well, but because it will be interpreted by php you will need to be careful about escaping special characters etc.

 

Jim

Posted
Yes you can put any html code into index.php. BE CAREFUL though you are offering a choice of languages and anything you put into /catalog/index.php will not change when a new language is selected. If you wish to use language specific stuff edit /catalog/inlcudes/languages/[language_of_choice]/index.php. You can put html in here as well, but because it will be interpreted by php you will need to be careful about escaping special characters etc.

 

Jim

 

Sorry, but what is meant by escaping special characters??

 

is that when you use \ before a " ? and if so could you give an example??

 

Thanks

 

Dan

Posted

If using text with PHP then any text used which has apostrophies in it has to have those apostrophies escaped with a preceeding backslash, as in:

 

Let's = wrong

Let\'s = right

 

This is taken from includes/languages/english/privacy.php (note the beginning and ending apostropies either side of the text):

 

define('TEXT_INFORMATION', 'Put here your Privacy Notice information.');

 

Now, if you change that to:

 

define('TEXT_INFORMATION', 'Let's put something here.');

 

you get a parse error - because php reads the apostrophy in Let's as being the end of the php statement, and so anything following it is not expected. But this would be correct and produce no error:

 

define('TEXT_INFORMATION', 'Let\'s put something here.');

 

Vger

Archived

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

×
×
  • Create New...