[PHP] Adding to cart function.

2002-10-25 Thread Steve Jackson
My boss wants me to add a number of items to the cart based on a user
form input. At the moment my add to cart function  checks if anything is
in it and then increments one item (using this code). I can supply the
full function if required but just this part would get me away I think.

if($cart[$new])
  $cart[$new]++;

Instead of incrementing by one how do I increment by a variable which
would be the form input?

Steve Jackson
Web Developer
Viola Systems Ltd.
http://www.violasystems.com
[EMAIL PROTECTED]
Mobile +358 50 343 5159


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Adding to cart function.

2002-10-25 Thread Justin French
Hi

?
$newamount = 5;

if($cart[$new])
$cart[$new] = $cart[$new] + $newamount;
?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php