Excellent. Thanks. I think I follow what you have done. But to clarify,
and learn, what are you doing with -= ?
$trolley[$item] -= $quantity;
Likewise, i had not followed what you were doing with the lines I
commented out. They did not seem to work, and I succeeded in doing what
I wanted without them. I'm a prof, as you can tell, and always have a
question for an answer ;).
Thanks for your time and patience,
John
//Delete an entry:
if( isset( $_SESSION['TrolleyContents'][$_POST['RNum']] ) )
{
# $_SESSION['TrolleyContents'][$_POST['RNum']] -= 1;
# if( $_SESSION['TrolleyContents'][$_POST['RNum']] <= 0 )
# {
unset( $_SESSION['TrolleyContents'][$_POST['RNum']] );
# }
}
Robert Cummings wrote:
On Sun, 2005-10-02 at 01:01, Robert Cummings wrote:
If you go with an array system might I suggest the following change to
what I wrote:
I'm resending a better way to do the simple trolley since you seemed to
have created a Frankensteinian merge of the two examples I sent
previously.
if( isset( $trolley[$item] ) )
{
$trolley[$item] -= $quantity;
if( $trolley[$item] < 1 )
{
unset( $trolley[$item] );
}
}