我正在尝试进行表查找。我填写字段,然后单击组合框旁边的链接进行查找。当我返回页面时,姓氏字段变为空白。当我返回页面时,我需要一种保持姓氏字段的方法。
<?php
session_start();
$_SESSION['form'] = $_POST; ?>
<?php /*?>
<?php if(isset($_POST['First'])) { echo htmlentities ($_POST['First']); }?>
<?php */?>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Last Name:</td>
<td><input type="text" name="Last_Name" id="Last_Name" autofocus value="<?php $_SESSION['form']['Last_Name'] ?>" placeholder="last name" size="32" /></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">City:</td>
<td><select name="LookupCity" id="LookupCity">
<option value="" <?php if (!(strcmp("", $_GET['City']))) {echo "selected=\"selected\"";} ?>>Select from menu</option>
<?php do { ?>
<option value="<?php echo $row_fmCity['City']?>"<?php if (!(strcmp($row_fmCity['City'], $_GET['City']))) {echo "selected=\"selected\"";} ?>><?php echo $row_fmCity['City']?></option>
<?php
} while ($row_fmCity = mysql_fetch_assoc($fmCity));
$rows = mysql_num_rows($fmCity);
if($rows > 0) {
mysql_data_seek($fmCity, 0);
$row_fmCity = mysql_fetch_assoc($fmCity); } ?>
</select>
<a href="ZipLookup.php?Last Name=<?php echo $Last_Name ?>">select</a></td>
Please give an example.