|
|
|
|||
|
Dear Guest, please register and confirm your account to remove these advertisements. i am trying to build a simple online shopping cart. Been strugling with 2 dimensional sessions array and when i finally got it working the session array is not updating. I want to be able to browse through each product page and keep adding the productid,quantity to $_session[cart]. But each time i add to cart the previous product ids and quantities are deleted from the session. Am i doing it correctly. Somebody please help.Thanks in advance. Code: <?php foreach($_POST as $var => $value) { if($value != '') { // add to session $_SESSION['cart'][$var] = $value; } } ?> <? foreach($_SESSION['cart'] as $pid => $qty) { echo "Product id: $pid, Quantity:$qty "; echo "<br>"; } ?> Thanks in Advance |
|
|||
|
i've done it, so yes. but, you may have to change your php.ini config
________________ Flyer Design | affiliate make money | Clothe Trend's |
|
|||
|
|
|
|||
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|