How can I get the following to open a window with the message variable? I'm assuming there is a way to get this to work but so far I've had no luck.
echo "<script>myWindow=window.open('','','width=200,height=100');
myWindow.document.write("$message");</script>";
given the contents of the $message variable...
$message = "<html><body><table>
<tr><td><strong>
Visitor's Name:</strong> ".$_POST['tester_name']."</td></tr>".
"<tr><td><strong>
Visitor's E-mail:</strong> ".$_POST['tester_email']."</td></tr>".
"<br /><tr><td><strong>Answers:</strong></td></tr>";
$x = 1;
$y = 0;
foreach($fields as $key => $field) {
if (preg_match("/q./", $field)) {
if ($field == "q3" or $field == "q9") {
$cor = (implode(" or ", $corArray[$y]));
} else {
$cor = $corArray[$y];
}
$message = $message.
"<tr><td><em>$x.</em> (
<b>Response:</b>".$_POST[$field].
")</td><td><b>Correct Answer:</b>".$cor."
</td></tr>";
++$x; ++$y;
}
}
$message = $message."<tr><td><br /><strong>
Score:</strong> ".$numCorrect."/10 or ".$perc."
%</td></tr></table></body></html>";