Originally posted by mt00trip
I need some help, I am an new php programmer
I am trying to create a drop down menu from a field in mysql
I can create the drop down menu, but I need to know how I can reference the selection that was made.?? can anyone help
Sure...
Let's say you have something like this:
<select name="var">
<?
while($row = mysql_fetch_row($yourresult))
{
print("<option value=\"" . $row[0] . "\">" . $row[0] . "");
}
?>
</select>
On the page you process this info (from the form) just add something like this:
$var = $HTTP_POST_VARS["var"];
( or $var = $_POST["var"]; on newer php)
That should get you started.
-- Jason