I would start by changing your checkbox input from this:
<input name=\"checked[$id]\" type=\"checkbox\" value=\"yes\">
to this:
<input name=\"checked[]\" type=\"checkbox\" value=\"$id\">
Now, in email-details.php, you can loop through all the checkbox values like this:
foreach ($_REQUEST['checked'] as $v) {
print "Checkbox $v was checked";
}
In my sample, you can replace the print statement with whatever code you have for emailing that particular row. You can send out one email per checked box by putting an email statement where the print statement is. Or you can send out just one email (with all the rows in it) by using the loop to build a string like this:
foreach ($_REQUEST['checked'] as $v) {
// check mysql for the data for id# $v
$email_string .= "Data for row $v: " . $date . $product . $serial . $mac . "\n";
}
// send $email_string to recipient
Also, I notice that in your technique, you are passing all the data via hidden fields. If the data is very large or there are a very large number of checkboxes that are checked, you run the risk of losing some of the data in the post from the first to the second page. You should only pass the id# in the checkbox. Then, in email-details.php, you can lookup the data again.
Also, there is a minor security risk here. A clever hacker can change the values of the hidden fields if she wants. You are trusting that the data that is passed from page 1 to page 2 has been unaltered and then you are performing some action on page 2. The right way to do this is to pass in the id#'s only (via the checkboxes) and then look up the data from the database on page 2. Not only do you prevent the risk of the data being too large... but you also increase the security. And the site runs faster and abuses your bandwidth less because you aren't sending data down to the user only to send it back up to the server.