在PHP中得到多选的下拉菜单的各项值(一个例子)
类别: PHP教程
<html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
if($submit){
for($i=0;$i<count($select);$i++)
echo $select[$i];
}
?>
<p> </p>
<form name="form1" method="post" action="">
<select name="select[]" size="6" multiple>
<option value="1" selected>111111111</option>
<option value="2">22222222</option>
<option value="3">333333333</option>
<option value="4">444444444</option>
</select>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
<head>
<title>Untitled</title>
</head>
<body>
<?php
if($submit){
for($i=0;$i<count($select);$i++)
echo $select[$i];
}
?>
<p> </p>
<form name="form1" method="post" action="">
<select name="select[]" size="6" multiple>
<option value="1" selected>111111111</option>
<option value="2">22222222</option>
<option value="3">333333333</option>
<option value="4">444444444</option>
</select>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
-= 资 源 教 程 =-
文 章 搜 索