passing values using get from a dropdown populated from a mysql database

Mago Alan

New Member
i have problem passing data from one page to another using GET, for examplei have these:\[code\]<form method=post action=edit.php><td><input type=text name=firstname></td><td><? $query="SELECT * FROM gender; $result = mysql_query ($query); echo "<select name=gender_id>"; while($nt=mysql_fetch_array($result)) { echo "<option value=http://stackoverflow.com/questions/3861002/$nt[gender_id]>$nt[gender_name]</option>"; } echo "</select>";?></td><td><input type=submit name=edit></td></form>\[/code\]now to pass these to edit.php using GET\[code\]if($mode=="edit"){$fistname=$_GET["fistname"];$gender=$_GET["gender_id"];<td><input type=text name=firstname value="http://stackoverflow.com/questions/3861002/<? echo $fistname; ?>"></td>\[/code\]Above is a working code for an input type text. I know how to pass values with input type text but my problem is that HOW WOULD I DO THESE WITH A SELECT tag WHICH HAS VALUES FROM A MYSQL DATABASE?.
 
Back
Top