我知道php是服务器端的,但是有没有办法让这个窗口在3秒后关闭呢?
<link rel="stylesheet" type="text/css" href="style1.css" />
<?php
$contact_message=$_POST['message'];
$errpage = $_POST['frompage'];
$ip=$_SERVER['REMOTE_ADDR'];
$message = "$contact_message -SENT FROM THIS IP: $ip";
mail("maxgee@me.com", "$Error Reported on: $errpage", $message);
echo "We have documented the web address of the problem and thank you for helping us improve our site!"
?>发布于 2012-10-09 09:40:38
这应该可以做到:
<script type="text/javascript">setTimeout("window.close();", 3000);</script>发布于 2017-01-07 19:10:05
这非常简单-只需在您想要移出自身的地方使用echo编写JavaScript代码,例如:
<?php
echo '<script> window.setTimeout("window.close()", 1000); </script>';
?>它肯定能行得通。
发布于 2012-10-09 10:45:46
如果我正在看的一个页面突然被关闭了,这可能看起来有点奇怪。
https://stackoverflow.com/questions/12791695
复制相似问题