robert_gsfame Posted March 30, 2010 Share Posted March 30, 2010 I wonder how can we create "add into basket", what are they actually using...session or cookies?? then how to create multiple session or cookies?? Thx in advance Quote Link to comment Share on other sites More sharing options...
the182guy Posted March 30, 2010 Share Posted March 30, 2010 I wonder how can we create "add into basket", what are they actually using...session or cookies?? then how to create multiple session or cookies?? thanks in advance You need to do some reading on PHP Sessions. Yes sessions are used to create a shopping basket application. Cookies are also used but the cookie part is usually behind the scenes and PHP does this automatically for you. A cookie is used to store the session ID on the users computer, which is then transmitted to the server with each page request. Quote Link to comment Share on other sites More sharing options...
robert_gsfame Posted March 30, 2010 Author Share Posted March 30, 2010 If i let any users including visitors without registration needed which means that no SESSION ID is required...so i only need to create cookie based on what product they're choosing....is that correct? Quote Link to comment Share on other sites More sharing options...
the182guy Posted March 30, 2010 Share Posted March 30, 2010 If i let any users including visitors without registration needed which means that no SESSION ID is required...so i only need to create cookie based on what product they're choosing....is that correct? You'll need a session regardless of whether the user is registered or just a guest. You would not normally store a reference to the product in a cookie. Normally the basket items are stored in the session like here for example, this would add a product to the basket array in the session: $_SESSION['BASKET']['ITEMS'][] = array('product_id' => 1234, 'product_name' => 'Shoes', 'qty' => 1); Quote Link to comment Share on other sites More sharing options...
robert_gsfame Posted March 30, 2010 Author Share Posted March 30, 2010 thx a lot! 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.