test5.php
<form action="test4.php" method="post">
Please input one package:(Goa, Kashmir, Rajasthan):<input type="text" name="package">
<input type="submit" value="submit">
<form>
test4.php
<label>Select Tour Package<span class="note">*</span>:</label>
<select name="package">
<option value="Goa" <?php ($_POST['package'] == "Goa")? "selected":"";?>>Goa</options>
<option value="Kashmir" <?php ($_POST['package'] == "Kashmir")? "selected":"";?>>Kashmir</options>
<option value="Rajasthan" <?php ($_POST['package'] == "Rajasthan")? "selected":"";?>>Rajasthan</options>
</select>
我想有这样的功能:当有人在 上输入一个包时test5.php
,会在 select-box on 中选择/选择相同的包test4.php
,但似乎不起作用,那么上面的脚本有什么问题?