Register_globals and Session problem

Discussion in 'PHP' started by sarahk, Aug 17, 2005.

  1. #1
    Hi

    I've got a site running PHPv4.3.11 and the host has register_globals turned on but the webhost desperately wants it turned off.

    They've got a really ancient shopping cart in there which stores the cart in sessions but not in a database etc. The shopping cart is due to be replaced so I need a quick fix if possible.

    So the problem...

    User clicks to add an item to the cart
    • script registers the session
    • scripts adds the cart to the session
    • script adds item to the cart
    • script redirects to a new page
    • new page reads the session and recreates the cart

    If I get a dump of the cart just before the redirect I can see the contents but just after it's empty again.

    I tried setting session_write_close but in firefox it made no difference, in IE I got huge error messages about using obsolete functions.

    So, I'm guessing that there's something that needs to be set but I can't see it. Any ideas?
     
    sarahk, Aug 17, 2005 IP
  2. Willy

    Willy Peon

    Messages:
    281
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Willy, Aug 17, 2005 IP
    sarahk likes this.
  3. sarahk

    sarahk iTamer Staff

    Messages:
    28,911
    Likes Received:
    4,556
    Best Answers:
    124
    Trophy Points:
    665
    #3
    Thanks Willy

    You wouldn't happen to have the table structure for those tables would you?

    Sarah
     
    sarahk, Aug 17, 2005 IP
  4. Willy

    Willy Peon

    Messages:
    281
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    0