<form action=''>
<!-- 下拉式選單 -->
<!--
<select name = 'select'>
<option value = "volvo">Volvo</option>
<option value = "saab">Saab</option>
<option value = "opel">Opel</option>
<option value = "audi">Audi</option>
</select>
-->
<!-- 單選 -->
<!--
男<input type='radio' name='sex' value='男' checked>
女<input type='radio' name='sex' value='女'>-->
<!--多選-->
<input type='checkbox' name='food[]' value='海鮮'>海鮮
<input type='checkbox' name='food[]' value='素食'>素食
<input type='checkbox' name='food[]' value='麵食'>麵食
<input type='submit' name='send'>
</form>
<?
// 單選
/*if(isset($_GET['send'])){
echo $_GET['sex'];
}*/
foreach($_GET['food'] as $item){
echo $item."<p>";
}
?> |