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! Link to comment https://forums.phpfreaks.com/topic/71791-an-updateable-shopping-cart-using-php-sessions-to-store-the-cart/ 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. Link to comment https://forums.phpfreaks.com/topic/71791-an-updateable-shopping-cart-using-php-sessions-to-store-the-cart/#findComment-361530 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. Link to comment https://forums.phpfreaks.com/topic/71791-an-updateable-shopping-cart-using-php-sessions-to-store-the-cart/#findComment-361537 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. Link to comment https://forums.phpfreaks.com/topic/71791-an-updateable-shopping-cart-using-php-sessions-to-store-the-cart/#findComment-361548 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.