Dear PtoP:
Here is the code I am trying to make work from the changing quantities part of the Pro PHP
Programming book's shopping cart. This is to go with the other email that I just sent. I
thought it may help. I just can't get my quantities to change from 1 to anything else. I have
tried the book examples and downloaded the code also. Here is the downloaded code I am
trying to make work. -------->>>>>>
<?php
require 'functions.php';
if ($button == "Change Quantity !!")
{
$index =0;
for($i=0;$i<$total_items;$i++) {
$tmp = "qty".$i ;
if ($$tmp == "0")
continue ;
else {
$items_tray[$index] = $items_tray[$i] ;
$quantity[$index] = $$tmp ;
$index++ ;
}
}
// Set the Cookie
for($i=0; $i < $index; $i++){
setcookie("quantity[$i]",$quantity[$i]);
setcookie("items_tray[$i]",$items_tray[$i]);
}
setcookie("total_items",$index);
header("Location:http://$HTTP_HOST/$DOCROOT/display.php");
exit();
}
else {
header("Location:http://$HTTP_HOST/$DOCROOT/confirm_order.php");
exit();
}
?>
Cullan Crothers
cullan.crothers@w...