Cookies or PHP Sessions - Save within MySQL table

Discussion in 'PHP' started by MattBOnline, Jun 2, 2011.

  1. #1
    Hi,

    How do I generate a cookie or PHP Session id depending on whether the user has cookies enabled and store 'either' within a MySQL table?

    I would like to design a shopping basket that uses cookies to remember what the user has added to the basket. If they do not have cookies enabled I want the basket to work with PHP Sessions instead. I know it is possible but I do not understand how to code it. What code do I use to add a cookie or start a PHP session if cookies disabled? And how do I 'post' (or add) the cookie, or PHP Session to a MySQL table?


    Matt.
     
    MattBOnline, Jun 2, 2011 IP