SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    May 2004
    Location
    NL
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Loaing cookie vars in php variables on loading page

    I'm setting a cookie with $_SERVER['HTTP_REFERER']; to store in our dbase when an order is placed, however, the cookie var is not loaded immediately in the variables when we set the cookie and load the page.

    A manual 'refresh' is needed for it top actually read the cooie and put the var in the orderlink. Is there a snipped to bypass this, or do we need to refresh the page automatically to prevent loss of this variable?

    We could use this after setting the cookie
    header("Location: http://www.example.com/");
    maybe even with $_SERVER[’REQUEST_URI’], but that seems stupid.

    Any help is appreciated.

  2. #2
    SitePoint Addict
    Join Date
    Jul 2006
    Location
    Kansas City, MO
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Store it in a session variable instead.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •