I have 1 form in with multiple checkboxes in it (each with the code):
<input type="checkbox" name="check_list" value="<? echo $row['Report ID'] ?>">
Where $row['Report ID']
is a primary key in a database -so each value is different.
How would I be able to tell which checkboxes have been checked? (Maybe multiple)
This is for an inbox system and I have a button below that I want (when clicked) to delete all messages (ids of: $row['Report ID']
) which have the checkbox's checked.
Best Answer
Set the name in the form to
check_list[]
and you will be able to access all the checkboxes as an array($_POST['check_list'][]
).Here's a little sample as requested: