How to retrieve select value with method POST in a PHP from?

vsrgiix

New Member
I am using this code in my form to create a drop down menu. (the list of options loads corrects from my sql database). Once the user hits submit, I should be able to retrieve the value selected with $_POST['field'].\[code\]<form action="page2.php" method="post" name="form" id="form"> <?php $query = sprintf("SELECT domaine FROM `domainema` WHERE userid='%s' ", $userid);$result=mysql_query($query);echo "<select name=domaine value=''>Domain </option>";while($nt=mysql_fetch_array($result)){echo "<option value=http://stackoverflow.com/questions/3863705/$nt[id]>$nt[domaine]</option>";}echo "</select>";?>...\[/code\]On the second page, I use this code:\[code\]$domaine = strip_tags(substr($_POST['domaine'],0,32));echo "You selected $domaine";\[/code\]But I get nothing a blank value, what am I doing wrong?Thanks!
 
Back
Top