Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Of course this was going to happen...


Recommended Posts

I’m an experienced PHP programmer that has inherited an osCommerce 2.2MS-2 site that was running on PHP 5.1. My goal has been to update it enough so that it would run on PHP 5.6 and maybe 7.2. I’ve made a lot of code changes to remove obsolete/deprecated features like:

- Replace MySQL calls with MySQLi

- Substitute deprecated keywords like ereg, ereg_match, split, each, etc

- Replace old HTTP_GET_VARS, HTTP_POST_VARS and so forth to their modern equivalents

I was very careful and meticulous but my greatest fear has been realized. Items won’t add to the cart any more. So it obviously has to be some code change that I must have made. I inserted some debugging code into application_top.php to see what I could figure out. I was able to see the database was receiving the session data:

Key: osCsid, Value: j085u28li7qg7rd4g718nthmc6

So I went to the database and found the data stored there:

SELECT * FROM `sessions` WHERE `sesskey` LIKE 'j085u28li7qg7rd4g718nthmc6'


So I feel like the item I put in the cart "went" there but I'm having trouble retrieving it later. I feel like I'm close to figuring it out if I knew where to look next. You all are a bunch of smart, good-looking people. What are the best methods to debug situations like these? Remember, I'm good at programming just not at the inner workings of osCommerce...

Link to comment
Share on other sites

It's doubtful you will get it to work with any version higher than 5.5. I suppose if enough time was spent on it, you could rewrite it enough to get a higher version to work. But that won't do much to fix the large number of security holes in the files or its speed. You would be much better advised to replace it with the latest Phoenix version. 

With that said, the compatibility.php and sessions.php files in the includes/functions/ directory have to be updated for the conversion to properly work. If you can find the latest RC2-A version, you can copy the files from it. Or, maybe, the ones in the version will work. You will probably have to clear the sessions database table. And, as i recall, there are some changes needed in the includes/application_top.php file. Those are posted here somewhere in the forums so you can use google to search for upgrading an ms2 shop and may find them.

Good luck.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites


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

  • Create New...