基本原理
用到了
<meta http-equiv="Refresh" content="5; url=" toUrl" >
content 5 表示5秒后对 页面刷新一次 页面的链接为 toUrl
function show_msg($msg_body, $url=''){
global $AUTHMENU,$FOOTER;
$output_str=<<<HERE
<html>
<head>
HERE;
if($url != "" && $url != -1)
$output_str.="<meta http-equiv="Refresh" content="1;URL={$url}">";
$output_str.=<<<HERE
</head>
<body bgcolor="#FFFFFF">
<table cellpadding="0" cellspacing="0" border="0" width="400" align="center" height="85%">
<tr align="center" valign="middle">
<td>
<table cellpadding="10" cellspacing="0" border="0" width="80%" align="center" style="font-family: Verdana, Tahoma; color: #666666; font-size: 12px">
<tr>
<td valign="middle" align="center" bgcolor="#EBEBEB">
<br>{$msg_body}
<br><br>
HERE;
if($url=='' || $url == -1)
$output_str.="<a href="javascript:history.go(-1)">返回继续操作</a> ";
else
$output_str.="<a href="{$url}">返回继续操作</a> ";
$output_str.=<<<HERE
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
HERE;
die($AUTHMENU.$output_str.$FOOTER);
}
本文介绍了一种利用HTML的<meta>标签实现页面自动刷新和跳转的方法,通过设置http-equiv属性为Refresh并指定content属性来控制刷新间隔及目标URL。
1173

被折叠的 条评论
为什么被折叠?



