Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

strpos() Error in index.php


rickhudson

Recommended Posts

Posted

I'm in the process of building a site using the latest osCommerce MS2.2 milestone 2 with the 051113 update.

 

I've encountered a problem that appears when you navigate from a sub-category back to the main index.php page. It displays the following error message:

 

Warning: strpos(): Empty delimiter. in /home/....../index.php on line 115

 

this error appears to be a problem with this line of line:

 

if (isset($cPath) && strpos('_', $cPath)) {

 

I've tried various items in posts on the forums but these merely seem to stop the categories from displaying at all on the main page.

 

I have the Main Categories and Product Listing in Columns contributions installed, but these don't appear to interfere with this part of the code at all.

 

Does anyone else have any ideas as to what may be causing this error and how I might fix it?

 

Any help provided would be much appreciated.

 

Regards

 

Richard

Posted
The arguments for that function are in the wrong order and you have to test the result. Try this:
if (isset($cPath) && strpos($cPath, '_') !== FALSE) {

 

Jack

 

 

This works perfectly - thank you so much for replying.

 

Given that this is a change to the standard code in the index.php file, maybe this fix should be reported via the Bug Reports on the osCommerce site! What do you think?

 

Regards

 

Richard

Archived

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

×
×
  • Create New...