Re: More on removing item from cart
| From: | Analysis & Solutions | Date: | Wed, 26 Jun 2002 00:44:25 +0000 |
| Subject: | Re: More on removing item from cart | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103862@lists.php.net to get a copy of this message | ||
Hi Vicki:
Combining what Erik and Richard wrote renders the key points you need to
grasp.
On Tue, Jun 25, 2002 at 05:04:48PM -0400, Erik Price wrote:
>
> Basically checkboxes are tricky, because if a checkbox is NOT checked,
> and then the form is submitted, an empty variable name is NOT sent...
> only checked boxes are sent.
Because of this, your code can't just look at the data sent for the
unchecked items.
Sometime today, Richard Wrote:
>
> You could just replace $cart with $checkbox yes? Since $checkbox
> will have all the new and updated variables that you need. So
> assign $_SESSION[cart] = $checkbox;
That's kind of what I was going after.
Since the people only need to get the checked items, what's in the
preexisting cart array just doesn't matter. There's no need to compare,
add or remove things from the cart. Just send the people the stuff they
checked off in the form.
Enjoy,
--Dan
--
PHP classes that make web design easier
SQL Solution | Layout Solution | Form Solution
sqlsolution.info | layoutsolution.info | formsolution.info
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409