Jump to content

PHP session errors after transfer from local development server to production server


JohnWaweru

Recommended Posts

I have a problem with my sessions and header redirects when I move my files from the local development machine to production server. Everything works well on the localhost but sessions cease to store data as required when moved to production. I have tried uploading to a different server to test whether it was a problem with how the other server was configured and it turns out I was right since the code works just as well as it did on my local development machine.

 

Can anyone point out what pitfalls I might be overlooking. The system is a simple shopping cart that redirects shoppers to the previous page they came from to continue shopping or to check out immediately after adding the product details. I have attached the code.

The buyer moves from: pricing.php -> wholesale.php -> addproduct.php then finally -> cart.php

 

pricing.php

 

wholesale.php

 

addproduct.php

 

cart.php

 

 

if you are getting actual error messages, posting them would be helpful.

 

if you are not getting error messages and the symptom is that session variables don't work, you need to set php's error_reporting to E_ALL and display_errors to ON, preferably in your php.ini, or alternatively in your script, immediately after the first opening <?php tag, and before all other php statements, to get php to help you by reporting and displaying any errors it detects.

Archived

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

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.