用惯java和其他语言的时候,表单上传只需要checkbox的name相同的时候就可以上传了
<input type="checkbox" name="checkbox" value="1"> 选项1
<input type="checkbox" name="checkbox" value="2"> 选项2
<input type="checkbox" name="checkbox" value="3"> 选项3
<input type='button' value='确定' onclick="fun()"/>
但是php却只有在这种情况下,name要写成数组形式才能正常表单提交
<input type="checkbox" name="checkbox[]" value="1"> 选项1
<input type="checkbox" name="checkbox[]" value="2"> 选项2
<input type="checkbox" name="checkbox[]" value="3"> 选项3
<input type="checkbox" name="checkbox[]" value="4"> 选项4
<input type="checkbox" name="checkbox[]" value="5"> 选项5
<input type="checkbox" name="checkbox[]" value="6"> 选项6
<input type='button' value='确定' onclick="fun()"/>