如何获得以下信息以打开带有消息变量的窗口?我假设有办法让它工作,但到目前为止我还没有运气。
echo "<script>myWindow=window.open('','','width=200,height=100');
myWindow.document.write("$message");</script>";
给定 $message 变量的内容...
$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>";