这是我的选择框或选项框。我用表“指定”填充它。但是在发布所选选项后,$ _POST中的值不可用。
<select name="reporting_head" class="form-control" >
<option value="" disabled selected>Select your option</option>
<?php
$sql = mysqli_query($db->link_id, "SELECT designation FROM tbl_designation");
while ($row = $sql->fetch_assoc()){
echo "<option value=" . $row['reporting_head'] . ">" . $row['designation'] . "</option>";
}
?>
</select>
这是我的$ _POST,
$ reporting_head = mysqli_real_escape_string($ db-&gt; link_id,(htmlspecialchars(trim($ reporting_head))));
我能找到解决方案吗?提前谢谢..
答案 0 :(得分:1)
我认为你应该这样写:
...(htmlspecialchars(trim($_POST['reporting_head']))));