[thelist] passing a non-form value into an array in php
1976 design
dunstan at 1976design.com
Tue Oct 29 16:46:01 CST 2002
Hi there,
I have finally figured out the shopping cart thing with arrays, but I
have one final problem with it.
As a reminder, an example of my shopping cart checkout form can be
seen here:
http://www.1976design.com/testarea/example.gif
I am passing all the information needed to update the user's shopping
cart to the array through the form fields, by ending their names with
[].
I am then putting these values into an array for each line and
updating the db table:
if (isset($update_buy))
{
$numrows = count($size1);
for ($i = 0; $i < $numrows; ++$i)
{
db update code here
}
}
the only problem is that I don't know how to pass the image number
into this code for each row? It's not a form element in the checkout
table.
The user's id is a session variable and so can be grabbed out the air,
the form values all come in through the array, but without the image
number it's all pointless as I can't target the db tale row to be
updated.
I can't work out how to get it so it can be used in the array loop.
Any ideas?
thanks very much - dunstan
More information about the thelist
mailing list