选择在HTML没有价值属性 - 您可以选择多个选项,这是由所选择的属性决定
selected="selected"<?php endif; ?>>In Inventory
selected="selected"<?php endif; ?>>In Process
selected="selected"<?php endif; ?>>Shipped/in-transit
selected="selected"<?php endif; ?>>Received by recipient
稍微好一点的办法: 选项元素
淤泥方式上
$options = array("In Inventory", "In Process", "Shipped/in-transit", "Received by recipient");
?>
selected="selected"<?php endif; ?>>
最好的方法 - 将这些选项存储在数据库表中 - 使用ID值而不是字符串可能会更好(可以更容易地更新选项标签),并循环使用从上面的数据库查询中获取的可能选项。如果这个选择列表被使用了很多,缓存查询的结果以获得选项(记住,如果列表得到更新,你需要清除缓存)