Jump to content


Photo

Possible Reset Problem


  • Please log in to reply
No replies to this topic

#1 jimpottle

jimpottle
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 10 October 2006 - 10:32 AM

Have a site that appears to work well under v5.1.6 (my personal test server) but gets caught up in some form of a loop under v4.4.1 (the ISP server).  Not sure what is happening but for some reason I believe it is to do with resetting the session variables used with the shopping basket.  Current code (a bit dirty but there it is) is as follows:

[pre]

if ($_SESSION['cart']) {
for (reset ($_SESSION['cart']); $key = key ($_SESSION['cart']); next ($_SESSION['cart'])) {
if ($product == $_SESSION['cart'][$key][product]) {
$_SESSION['cart'][$key][qty] = $_SESSION['cart'][$key][qty] + $qty;
$new_qty = 1;
}
}
}
[/pre]

Any further information can be provided so long as I can understand what is being asked for ;-)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users