tags:

views:

42

answers:

1

I have this database field that used as the form input value '. $variety['price']. ' I also have a '. $variety['size']. ' database field that carry the name of the product but I don't know what another form input property to use to assign this size database field as a value to the input form property?

I feel like I have run out of properties to carry more values to other values beside price to cart.php.

Thank you the script is as below.

<form action="cart.php" method="post">
foreach($product['varieties'] as $variety){ 
echo'<input style="width:10px; margin-left:9px; " name="price[]" type="checkbox" value="' . $variety['price']. '"  />';
}
</form>
A: 

The list() does exactly that, yes.

Try something like this with you php script: - Submit your form, to another script, say, carttest.php - Put this code in carttest.php.

<?php
echo "<pre>";
print_r($_POST);
echo "</pre>";
?>

You will see what data structure you have to deal with. from there, you might be able to work it out. Also look at some information on how to handle arrays in html form.

Mademoiselle Vagin Cul
what the list function will do here?
jona
will it make $price and $size two independent variables?
jona
excuse me I question you a lot but I don't understand how to receive it in the page script. you said I should put the name="price[id]" in the form or leave it is?
jona
So, did it solve your problem?
Mademoiselle Vagin Cul
I solved that problem, but that was not the way I supposed to go about it. it did worked but now there is a query troubling me..
jona