1

我想要一个 PHP 脚本运行,它在新窗口中定位并打开结果,然后关闭运行脚本的原始页面。这是我的脚本。它在 IE 9+ 上运行良好,但我们无法让它在 IE 8 上运行。似乎 window.close 也在关闭“生成的”窗口?

<?php

$sn = $_GET['sn'];

$files = array();

$filepath = '/data/.../.../.../ABC';
$urlpath = 'http://AAA.slcusd.org';

$files = glob("$filepath/$sn*.pdf");

echo "<script type='text/javascript'>\n";

foreach ($files as $fullfilename) {
  $filename = substr($fullfilename, 37, 20);
  echo "window.open('$urlpath/$filename','_blank');\n";
}

echo "window.open('', '_self', ''); window.close();\n";

echo "</script>\n";

?>
4

0 回答 0