your checkboxes have a parameter called "name", this name will appear in php as the variable name.
set this name to "msg[$id]", so it will be an array in php with the id of the message as array key.
then, when delete button is pressed,
$msg_to_delete = $_REQUEST['msg'];
will give you an array "$msg_to_delete". the key's of this array are, like said above, the message id's you have to delete.
now you need an function that makes you a new array with the key from this array as a VALUE.
that's easy:
while(@list($key, $val)=@each($msg_to_delete)) {
$arr_msg_to_del[] = $key;
}
now you need to run a loop reading this new array that creates an sql statement and executes this what deletes all entry from DB with ID = $arr_msg_to_del[X]
for($i = 0; $i < count($arr_msg_to_del); $i++)
{
$id = $arr_msg_to_del[$i];
$query = "DELETE FROM table WHERE id = '$id';";
mysql_query($query);
}
ok, this will only work if you use mysql, but i hope you understand how to realise it.
Bye bye
Thorsten