Handle the details of a single name multi value form
- 2020-06-07 04:07:19
- OfStack
Just use a simple multi-choice select:
<?php
echo<<<EOT
<form action="" method=get>
<select name="listVar[]" multiple="multiple" size=3>
<option>first</option>
<option>second</option>
<option>three</option>
<option>four</option>
<option>five</option>
</select>
<input type=submit value= submit name=submit>
</form>
EOT;
/* The output GET To (array) */
if (isset ($_GET["submit"])) {
foreach($_GET["listVar"] as $value){
echo $value."<br>";
}
}
?>