PS:参考 C# 系统应用之Cookie\Session基础知识及php读取Cookie\Session
代码如下:
<?php session_start(); session_destroy(); //清空以创建的所有SESSION setcookie(session_name(),'',time()-1); $_SESSION = array(); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>登出系统</title> <link href="css/mycss.css" type="text/css" rel="stylesheet"/> </head> <body> <div id="main"> <TABLE cellSpacing=0 cellPadding=0 width="100%" background="images/header_bg.gif" border=0> <!--头部图片--> <TR height=80> <TD width=260> <IMG height=80 src="images/logo.gif" width=260> </TD> </TABLE> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR bgColor=#1c5db6 height=20> <TD></TD></TR> </TABLE> <!-- 布局中部 --> <div id="middle"> <div id="logout_middle"> <H3 style="COLOR: #880000">注销成功</H3> <H4>您已经登出系统!欢迎下次登录!<br />系统将在 <input type="text" style='font-size:18px; border:0px; width:20px;' readonly="true" value="5" id="time">秒后返回主页游客查看界面 </H4> </div> <!-- 时间函数 --> <script language="javascript"> var t = 5; var time = document.getElementById("time"); function fun() { t--; time.value = t; if(t<=0) { location.href="index.php"; clearInterval(inter); } } var inter = setInterval("fun()",1000); </script> </body> </html>实现的效果如下:
最后希望文章对大家有所帮助,也尝试不同风格,写点短文章。
(By:Eastmount 2015-2-21 http://blog.csdn.net/eastmount/)
(By:Eastmount 2015-2-21 http://blog.csdn.net/eastmount/)