connor4312
03-16-2011, 06:17 PM
Hi,
I have a list of posts generated from a mysql database with checkboxes whose name is their corresponding post's ID, and using those checkboxes one should be able to delete the posts.
I've tried
print_r($_POST['todelete']);
foreach($_POST['todelete'] as $key => $my_var) {
printf("Key #%d has the value <strong>%s</strong>", $key, $my_var);
}
But that only shows the checks that are on, like:
Key #0 has the value onKey #1 has the value onKey #2 has the value onKey #3 has the value on
So, I'm basically asking how to retrieve the data from all form elements, checkboxes, regardless if they are on or off.
I have a list of posts generated from a mysql database with checkboxes whose name is their corresponding post's ID, and using those checkboxes one should be able to delete the posts.
I've tried
print_r($_POST['todelete']);
foreach($_POST['todelete'] as $key => $my_var) {
printf("Key #%d has the value <strong>%s</strong>", $key, $my_var);
}
But that only shows the checks that are on, like:
Key #0 has the value onKey #1 has the value onKey #2 has the value onKey #3 has the value on
So, I'm basically asking how to retrieve the data from all form elements, checkboxes, regardless if they are on or off.