Here is my code: - and I am using POST
//get list of products
$query = "SELECT productname,desc,featurenum,price FROM products WHERE catid = '$_GET[catid]'";
//now I am getting the product features to populate the list menu
$query_rsfeatures = "SELECT featurenum,featurename,featureprice FROM features";
//this displays the products
while ($row = mysql_fetch_array($results)) {
extract ($row);
echo "<td valign='top'>";
echo "<a href = 'getprod.php?prodid=" . $prodnum ."'>";
echo "<img src='images/".$prodimage."'</td></a>";
echo "<div align='left'><a href = 'getprod.php?prodid=" . $prodnum ."'>View more »</a> </div>";
echo"<td valign='middle'>";
echo "<a href = 'getprod.php?prodid=" . $prodnum ."'>";
echo $name ."</a><br><br>".$desc_short;
echo "<br>";
//show product options if they exist
if ($featurenum > 0) {
echo "<br>Options:<br><select name='prodfeature'>";
while ($row_rsfeatures = mysql_fetch_array($rsfeatures))
{
echo " <option name='prodfeature' value=" . $row_rsfeatures['featureprice'] . ">" . $row_rsfeatures['featurename'] . "+" . $row_rsfeatures['featureprice']
. "</option>\n";
}
}
echo "</select><br></td>";
echo"<td valign='bottom'>";
echo "<a href='getprod.php?prodid=" . $prodnum ."'>";
echo "€" . $price;
echo "<br><br></td>";
echo "<td valign='bottom'>";
echo"</a><form method='POST' action='add.php'> Quantity:";
echo"<input type='text' name='qty' size='2' value='1'>";
echo"<input type='hidden' name='prodnum' value=".$prodnum.">";
echo"<input type='submit' name='Submit' value='Add to cart'>";
echo"</form>";
echo"<form method = 'POST' action='cart.php?prodid=".$prodnum .">";
echo"<input type='submit' name='Submit' value='View cart'>";
echo"</form></td></tr>";
}
the form submits to a page:
$qty =$_POST['qty']; //this is okay
$prodnum = $_POST['prodnum']; //this is okay
$prodfeatures = $_POST['prodfeature']; //this is empty!!