I'm adding a shopping cart to a website. On the catalog page there is a drop down menu containing options for a particular product. All of the product and product options are stored in a database.
My question is: How do I get the information in the drop down menu to move to the shopping cart (cart.php) when the user presses the submit button?
Here is the code:
<?php
include("db.php");
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
$result = mysql_query("select * from items order by itemName asc");
?>
<form name="form1" method="post" >
<select name="select" size="1" class="text" >
<option value="(<? echo $row["itemId"]=2;?>)" >6 inch Cream $22</option>
<option value="(<? echo $row["itemId"]=6;?>)" >6 inch Honey $22</option>
<option value="(<? echo $row["itemId"]=7;?>)">6 inch Green $22</option>
<option value="(<? echo $row["itemId"]=9;?>)">6 inch Red $22</option>
<option value="(<? echo $row["itemId"]=10;?>)">12 inch Cream $30</option>
<option value="(<? echo $row["itemId"]=11;?>)">12 inch Honey $30</option>
<option value="(<? echo $row["itemId"]=12;?>)">12 inch Green $30</option>
<option value="(<? echo $row["itemId"]=13;?>)">12 inch Red $30</option>
</select>
// Code attached to the button
<a href="cart.php? action=add_item&id=<?php echo$row["itemId"]; ?>&qty=1"
</form>
Now I know there is probably alot wrong with this code but I am very new to PHP and MySQL but I think I can understand the problem if I can get some help with the solution.
I just need one of these drop down fields to be sent to the cart.php when the button is pressed.
Any help would be much appreciated!
Thanks,
TJ