Getting checkbox values
Posted: Sat Feb 24, 2007 12:01 pm
I have a table that lists the users of my website and the status of them, either 1 (enabled) or 0 (disabled).
For every user I have a checkbox:
After I submit, how do I get the value of them? I want it to update each user:
It will all be under:
For every user I have a checkbox:
Code: Select all
echo "<input name='checkbox[]' type='checkbox' id='checkbox[]' value='$r[id]'";
if ($r[status] == "1") {
echo " checked='checked'";
}
echo ">";Code: Select all
$sql = "UPDATE `Users` SET `active`='" . $val . "' WHERE id='$id'";It will all be under:
Code: Select all
if($Submit){
}