但是提交表单时,它不会保留选中的复选框。例如,如果我选择并选中了两个复选框,即使在提交表单后,我如何让它们保持选中状态?谢谢。
下面是我所拥有的。
<form method='post' action=''>
<?php
$SQLbrands="SELECT * FROM brands";
$runBrands=mysqli_query($db, $SQLbrands) or die ("SQL Error");
$noRow=mysqli_num_rows($runBrands);
$brndTable = "<table border='1' cellspacing='0' cellpadding='1' id='brndTable1' class='brndTable1'>";
$brndTable .= "<thead><tr><th class='brT11'>Brand Name</th><th class='brT21'>Variant</th><th class='brT31'>SKU</th><th class='brT41'></th></tr></thead>";
$brndTable .= "<tbody>";
while ($reK = mysqli_fetch_array($runBrands))
{
$wec = $reK['id']; $wec2 = $reK['bvariant']; $wec3 = $reK['bsku'];
$brndTable .= "<tbody class='colormine'><tr>";
$brndTable .= "<td class='brT1'>".$reK["bname"]."</td>";
$brndTable .= "<td class='brT2'>".$reK["bvariant"]."</td>";
$brndTable .= "<td class='brT3'>".$reK["bsku"]."</td>";
$brndTable .= "<td class='brT4'><input type='checkbox' name='checkedMe[]' value='$wec' /></td>";
$brndTable .= "</tr>";
}
$brndTable .= "</tbody>";
$brndTable .= "</table>";
echo $brndTable;
?>
<input type="submit" name="sendone" id="sendone" value="OneClick">
</form>