I'm sure there are other better methods that I'm unaware of- just trying to take the simplest approach. Will post additional code as needed:
Selection php results from previous page:
<div id="stage1sat" class="stageBox">
<h3>STAGE 1</h3>
<table>
<?php
ob_start();
if ( ! empty($_POST['id']))
{ foreach($_POST['id'] as $key => $id) { $_POST['id'][$key] = mysql_real_escape_string($_POST['id'][$key]); }
$in = implode(', ', $_POST['id']);
$sqlSAT1 = "SELECT * FROM bandSched WHERE day='saturday' AND stage='stage 1' AND id IN ($in) ORDER BY FIELD(id, $in)";
$result = mysql_query($sqlSAT1) or die('MySQL Error ' . mysql_errno() . ': ' . mysql_error());
}
if ( ! isset($result))
{
echo 'You did not select anything';
}
else
{
while ($row=mysql_fetch_assoc($result))
{
echo "<tr>";
echo "<td>". $row['timeShow'] ."</td><td>" . $row['bandName'] . "</td>";
echo "</tr>";
}
}
?>
</table>
</div>
EmailProcess.php
<?php
$to = $_POST["email"];
$subject = "FPSF SCHEDULE";
$message = ob_get_clean();
$headers = "From: The Server <[email protected]>" . "\r\n" .
"Content-type: text/html" . "\r\n";
mail($to, $subject, $message, $headers);
?>
You can wrap the result of those php files with
ob_start()
and$message = ob_get_clean()
.Or change those php to write result to a variable (instead of
echo
ing them).