I have this code:
$sql = "SELECT DISTINCT name FROM products";
$result = mysql_query($sql);
echo "<select name="product" size= 1>";
<?php
while($row = mysql_fetch_row($result)) {
echo "<option value = \"" . ($row[1]) . "\">"
. ($row[0]) . "</option>\n";
}
echo "</select>";
?>
It creates a dynamic option box based on the names of products in the products table. My question is, when submit is pressed and the page is re-loaded ($PHP_SELF) how do I know which option has been selected?
I have tried echo'ing $product (from 'name="product"' to no avail.
Any help would be greatly appretiated.
Many thanks
Dan Burton