1
我有下拉编辑表单。 所有ISBN记录都列在下拉列表中。用户将选择他想要更新的ISBN。现在如何获得该用户选择哪个ISBN记录? 我的下拉菜单的逻辑如下:如何获取在其他页面上选择的值?
function update()
{
$select_query="Select ISBN from book";
$select_query_run = mysql_query($select_query);
echo"<form method='post' action='update.php'><center>Select ISBN you want to Update: ";
echo "<select name='isbn' id='isbn'>";
while ($select_query_array=mysql_fetch_array($select_query_run))
{
echo "<option value='' >".htmlspecialchars($select_query_array["ISBN"])." </option>";
}
echo "</select>";
echo '<br><br><br><input type="submit" value="Update"></center></form>';
} After selecting ISBN the user will be navigated to update php page whoch is as follow:
<?php
$isbn=$_POST['isbn'];
echo "ISBN Selected: ".$isbn;
?>
更新页面的输出: ISBN选择:
并设置属性'selected'到''
将由用户选择不是他 – achecopar
是的,它会根据用户选择 – Saty