Prova kod enligt nedan
Fel
- Först använde du
POST
metod i form och få variabel medGET
-
Du kan prova som nedan för att få kryssrutavärde
if ($subssm) { <input type='checkbox' name='subssm[]' value='1' /> }else{ <input type='checkbox' name='subssm[]' value='0' /> }
*PHP *
<form name="staff" method="get" onsubmit="return validateForm()" action="commit.php?action=<?php echo $_GET['action'] ?>">
<tr>
<td height="12" align="right" bgcolor="#CCCCCC"><h5> </h5></td>
<td height="12" align="left" bgcolor="#dfdfdf"> <input type="checkbox" name="subagent[]" value="<?php echo $subagent; ?>" /> Agent <input type="checkbox" name="subum[]" value="<?php echo $subum; ?>" /> UM </td>
<td rowspan="2" align="left" bgcolor="#dfdfdf">
<h6> * Selected one or more</h6></td>
</tr>
<tr>
<td height="12" align="right" bgcolor="#CCCCCC"><h5> </h5></td>
<td height="12" align="left" bgcolor="#dfdfdf">
<?php
if ($subssm) {
<input type='checkbox' name='subssm[]' value='1' />
}else{
<input type='checkbox' name='subssm[]' value='0' />
}
?>
SSM <input type="checkbox" name="subtutor[]" value="<?php echo $subtutor; ?>" /> Tutor </td>
</tr>
<input type="submit" name="Submit" value="<?php echo $_GET['action'] ?>" />