Forum Moderators: coopster

Message Too Old, No Replies

Adding multiple items to cart from a table

get quantities in list to post from form

         

stephanisat

12:04 pm on Jul 29, 2009 (gmt 0)

10+ Year Member



I am fairly new to PHP and need help with one portion of a project. I have all of my items listed in a table on one page with a dropdown list at the end of each row. I need to be able to post the item, item price, and selected quantity to another page when submitted. The only piece of the puzzle I don't have is how to get the form to recognize the quantity selected from the dropdown. (item and id fields are unique, if that helps) The dropdown uses the option feature to list the same quantity available for all items.

Thanks for any help.

jatar_k

12:22 pm on Jul 29, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld stephanisat,

you would just use the name of the form element in the $_POST array

<select name="quantity3">

once submitted

echo $_POST['quantity3'];

a little trick to look at what's in your $_POST array, put the following code at the top of your processing script

echo '<pre>';
print_r($_POST);
echo '</pre>';