smartin1017 Posted February 20, 2009 Share Posted February 20, 2009 Hi guys, I have a question about a shopping cart. I am about to try and build one but am hearing diffrent ways to do it and wanted to get some advice. Some are saying to use a cookie to store the ids of the items and just have the cookie last forever, some are saying to use a cookie to store a unique id generated from a database and have the DB store the items and some are saying to ask for an email address and password. What do you guys think, there are pros and cons to all of them in my mind. I would like to get your opinions. Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/146180-shopping-cart-question/ Share on other sites More sharing options...
jackpf Posted February 20, 2009 Share Posted February 20, 2009 You'd have to use cookies whichever way you do it. If it were me, I'd require users to log in each time they purchase something. Then, when they add something to their cart, store the ID of the item in an encrypted cookie, and when they go to the checkout, you can grab the ID(s) from the cookie, and get the corresponding item(s) from the database. Quote Link to comment https://forums.phpfreaks.com/topic/146180-shopping-cart-question/#findComment-767508 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.