我想关闭选项卡并销毁php中的会话。
我有这段代码,但是不能很好地工作。
<?php
session_start();
session_destroy();
?>
<script language="javascript">
setTimeout("self.close();",10000)
</script>
帮助通过,谢谢。
编辑:它没有按预期关闭窗口
function openWin()
{
myWindow=window.open("","","width=200,height=100");
myWindow.document.write("<p>This is 'myWindow'</p>");
}
function closeWin()
{
myWindow.close();
}
希望您尝试过使用firefox浏览器进行测试
在firefox中,您只能通过JavaScript关闭通过脚本调用window.open()打开的窗口。
请参考下面的链接
关闭火狐