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

 

 

Link to comment
Share on other sites

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.

Edited by mac_gyver
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.