我有以下代码,它将必要的数据完美地插入数据库。但问题是,当我想实现 select="select".. 这样如果客户返回,他将看到他从下拉菜单中选择的内容......我该怎么做,任何想法......
<pre>
<?php
//array generated from mysql to feed first dropdown menu.
$newOptions = array();
foreach ($input as $option) {
$wclID = $option['desc'];
$nameF = $option['fame'];
$nameL = $option['lname'];
$id = $option['ID'];
$newOptions[$wclID][$id] = $nameL." ".$nameF;
}
//second array for second dropdown menu
$array = array('ent','res');
?>
<div class="control-group">
<div class="controls">
<form id="checkEnt" name="che" method="post" action="com.php?ID=<?=$ID?>">
<input type="hidden" value="che" name="ent">
<table class="table table-striped span10">
<tbody>
<? foreach ($newOptions as $wclID => $list) { ?>
<tr><td width="5%">
<h5><?=$wclID?> AA</h5>
</td>
<td width="10%">
<label class="control-label" for="inputWei"><?=_('Boy')?></label>
<select class="input-xlarge" id="input" name="drop[0][]">
<option value=""><?=_('[select]')?></option>
<?php
foreach ($list as $key => $value) {
?><option value="<?=$key?>"><?=$value?></option>
<?php } ?>
</select>
</td>
<td width="10%">
<label class="control-label" for="inputWei"><?=_('Res')?></label>
<select class="input-xlarge" id="drop" name="drop[1][]">
<option value=""><?=_('[select]')?></option>
<?php
foreach ($array as $key => $value) {
?><option value="<?=$value?>"><?=$value?></option>
<?php } ?>
</select>
</td>
</tr>
<?
}
?>
<tr><td colspan="3">
<div class="modal-footer">
<button type=reset class="btn btn-danger"><?=_('Reset')?></button>
<button class="btn btn-primary" ID="btnSave"><?=_('Save')?></button>
</div>
</td>
</tr>
</tbody>
</table>
</form>
</div>
</div>
</pre>