snow Posted October 4, 2007 Share Posted October 4, 2007 Hi guys, I'm new at PHP, and currently for university I am undertaking a project with the objective to create "An updateable shopping cart, using PHP sessions to store the cart." Obviously this is too much for anyone to just 'help' me do, so I was wondering whether anyone here could suggest a helpful guide that would help me to understand how to create this. Any help would be much appreciated, thanks in advance. Edit: and yes sorry I forgot to mention I have been looking around on google but haven't found anything really helpful! Quote Link to comment Share on other sites More sharing options...
ShoeLace1291 Posted October 4, 2007 Share Posted October 4, 2007 You could have a code that generates a random string of letters/numbers that would be a session id for taht user. You of course would then set the session as maybe $_SESSION[cart_id] = $string. Then at the top of your update cart page, just get the users session. You would then have a table that would be called "cart items" that would look like this: itemID cartID then when the user clicks on add item or something, make the link something like additem.php?item=$itemid (you would use $_GET['item'] to get $itemid). Then you just insert the item and the session id's into the database. Hope that helps. Quote Link to comment Share on other sites More sharing options...
joeysarsenal Posted October 4, 2007 Share Posted October 4, 2007 ive been doing something to. I followed the tutiroil Go to google and google plaincart its very good example. comes with admin control but im having session problems with it. But if your not gonna move it into html u shouldnt have no problems. Quote Link to comment Share on other sites More sharing options...
snow Posted October 4, 2007 Author Share Posted October 4, 2007 that looks very good, however I need to store data in php not through a database. but thanks i'll look into it. please any more suggestions are welcome. 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.