Your code checks $delete which will be set if just one username is selected. So, let's not allow this to happen and use an array with our delete checkbox:
<input type="text" name="delete[]" value="<?php echo $username ?>">
The above is used when generated the html form, $username I assume is $row['username'] or whatever...
Then in your processing code to delete, you might have something like:
if (is_array($_REQUEST['delete'])) {
$sql = "DELETE FROM sometable WHERE username IN (". implode($_REQUEST['delete'], ',') . ")";
if (!$result = mysql_query($sql)) {
print "Could not delete ($sql) : " . mysql_error();
exit;
} else {
print "delete successful";
}
}
It may seem a little complex but we're creating a dynamic sql query that'll delete all rows that are in the delete array.