根据form表单提交的值,默认将select下拉框的option值选中:
<label>是否推荐:</label> <select class="input-text" name="is_recommend"> <option value="0" <?php if($is_recommend=="0"){echo "selected";} ?> >不限</option> <option value="1" <?php if($is_recommend=='1'){echo "selected";} ?> >是</option> <option value="2" <?php if($is_recommend=='2'){echo "selected";} ?> >否</option> </select>