有人可以幫我嗎?我無法使用多重選擇回覆我的複選框組。 每次我隨聲附和複選框組的唯一的東西展示的是最後的框,香港專業教育學院檢查。如何回顯複選框組?
這裏是我的代碼
<?php
$submit = $_POST['submit'];
$incharge = $_POST['incharge'];
if ($submit)
{
echo $incharge;
}
?>
<table width="500" height="69">
<tr>
<td width="73"><label>
<input type="checkbox" name="incharge" value="1" id="responsible_0" />
MNFA</label></td>
<td width="72"><label>
<input type="checkbox" name="incharge" value="2" id="responsible_1" />
HJB</label></td>
<td width="70"><label>
<input type="checkbox" name="incharge" value="3" id="responsible_2" />
JBG</label></td>
<td width="75"><label>
<input type="checkbox" name="incharge" value="4" id="responsible_3" />
MSG</label></td>
<td width="275"><label>
<input type="checkbox" name="incharge" value="5" id="responsible_4" />
MGR</label></td>
</tr>
<tr>
<td height="33"><label>
<input type="checkbox" name="incharge" value="6" id="responsible_5" />
AAP</label></td>
<td><label>
<input type="checkbox" name="incharge" value="7" id="responsible_6" />
EPM</label></td>
<td><label>
<input type="checkbox" name="incharge" value="8" id="responsible_7" />
SGA</label></td>
<td><label>
<input type="checkbox" name="incharge" value="9" id="responsible_8" />
JLL</label></td>
<td><label>
<input type="checkbox" name="incharge" value="10" id="responsible_9" />
AFM</label></td>
</tr>
</table>
預先感謝您..。
我看到一些不使用[]符號的網站。相應的請求變量會在請求數組中出現好幾次。例如。如果在上面的表單中檢查兩個複選框,則URL字符串(在GET的情況下)將包含具有不同值的兩次「incharge」。 – Tchypp
哦,網上有很多教程沒有提到[]符號。 – Tchypp