Oh, let me see if you have this right.
You have a list of checkboxes in a form. A user needs to check one or more boxes to delete users. If no checkbox is selected (i.e. checked) and the "Delete" button is pressed, you want to show an error message.
That's as simple as checking to see if $_POST['whatever'] is set. Here's what I would do.
Set up your form so all the checkbox elements have names like "del[$userid]" and a value of the "$userid". Something like:
while($row = mysql_fetch_array($result))
{
echo '<input type="checkbox" name="del[' . $row['userid'] . ']" value="' . $row['userid'] . '" />';
/* Display whatever else in the form for that user you want here */
}
That should give you a form with inputs looking like:
<input type="checkbox" name="del[XX]" value="XX" />
NOTE: "XX" would be replaced by the user ID, they're just place-holders in this example.
Now, in your PHP you can simply do the following:
if(!isset($_POST['del']) || empty($_POST['del']))
{
// No checkboxes were selected, either the checkbox array wasn't sent
// or it was sent, but it was an empty array
echo '<h3>ERROR</h3><p>You forgot to select someone.</p>';
}
else
{
// There is something in the array, loop through it to delete them
foreach($_POST['del'] as $key=>$userid)
{
// Delete the user based on $userid
}
}
Hope that helps.