我要做的是从选择列表中选择值并在href调用中使用它,这是一个例子:
$query="SELECT distinct(loca_cod) as id, localidad as nombre FROM $tabla WHERE parti_cod='$stateId' order by nombre asc";
$result=mysql_query($query);
?>
<div class="styled-select">
<select name="city">
<option>Seleccione Localidad</option>
<? while($row=mysql_fetch_array($result)) { ?>
<option value = "<?=$row['id']?>"><?=$row['nombre']?></option>
<? } ?>
</select>
</div>
<br />
</tr>
<tr><td> </td><td></td></tr>
<tr>
<td><a href="step2.php?uch=HERE GOES THE VALUE SELECTED FROM USER class="boton_res">Continue</a></td>
</tr>
有关如何进行的任何提示? 谢谢!
答案 0 :(得分:0)
尝试使用do而不是
<option>Seleccione Localidad</option>
<? do {?>
<option value = "<?=$row['id']?>"><?=$row['nombre']?></option>
<? } while($row=mysql_fetch_array($result)) ; ?>
</select>
</div>
<br />
</tr>
<tr><td> </td><td></td></tr>
<tr>
<td><a href="step2.php?uch=HERE GOES THE VALUE SELECTED FROM USER class="boton_res">Continue</a></td>
</tr>