问问题
10793 次
2 回答
11
给它起一个名字[]
,例如:
<select id="industryExpect" name="industryExpect[]" multiple="multiple">
<option value="1">item1</option>
<option value="2">item2</option>
<option value="3">item3</option>
</select>
然后在您的$_POST
数组中,您将获得所有选定选项的数组:
// assuming that item1 and item3 were selected:
print_r($_POST['industryExpect']);
/*
array
(
0 => 1
1 => 3
)
*/
于 2009-09-21T04:43:50.533 回答
1
启动 Html 文件。前任。一个.html
<form action="process.php" method="post">
<select name="names[]" multiple="multiple">
<option value="john">john</option>
<option value="jack">jack</option>
</select>
<input type=hidden name=submitted>
<input type=submit name=submit>
</form>
进程.php:
<?php
print_r( $_POST['names'] );
?>
于 2009-09-21T04:36:39.910 回答