ipwnzphp Posted February 6, 2007 Share Posted February 6, 2007 Hello, I need some with something i cant seem to figure out at all. I'm using sessions and im trying to make this shopping cart work at http://www.nightmaredesigns.com/previews/halifaxgrocery/view_cart.php what is going on is that i cant seem to figure a way to store the products in the cart with out storing them in the shopping cart database in mysql. I have the shopping cart table storing the id of the product than pulling the info using a session to retrieve that data for that product. Now i could put these in a array correct? I mean but once u go back and hit add to cart again it needs to see that it needs to make a new row and not over write what is already stored there. Any ideas? Quote Link to comment Share on other sites More sharing options...
only one Posted February 6, 2007 Share Posted February 6, 2007 either use cookies or save it in the database with their ip..... Quote Link to comment Share on other sites More sharing options...
ipwnzphp Posted February 6, 2007 Author Share Posted February 6, 2007 i tried storing it in a cookie and then if you do the ip and there ip changes than it wont match whats in the cart so there for u have mysql info thats just sitting there that cant be removed by the user. Quote Link to comment Share on other sites More sharing options...
s0c0 Posted February 6, 2007 Share Posted February 6, 2007 How often does any IP really change though? comcast its once or twice a year, dsl it's eveyr few days. I think you are okay with the cookie. Quote Link to comment Share on other sites More sharing options...
ipwnzphp Posted February 6, 2007 Author Share Posted February 6, 2007 say if there internet goes out than there ip could change and most likely well. Quote Link to comment Share on other sites More sharing options...
s0c0 Posted February 6, 2007 Share Posted February 6, 2007 Can you make them create a simple login (maybe just email/pass) and use that to save shopping cart info in a cookie? That at least avoids the IP problem, but introduces other unrelated potential problems. Quote Link to comment Share on other sites More sharing options...
s0c0 Posted February 6, 2007 Share Posted February 6, 2007 Newegg for instance uses a cookie to store shopping cart information. Maybe go to newegg.com, add something to a cart then go to the folder your cookies are stored in C:\Documents and Settings\%username%\Cookies and see how they do. If it works for them it should work for you. Quote Link to comment 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.