php跳转函数

这个PHP跳转函数,是用的smarty模板引擎,下面是函数体.

这段是PHP函数代码

/**
* 跳转页面
*
* @param string $sURL 要跳转的链接
* @param integer $iTime 需要跳转时间
* @param string $sMsg 跳转的信息提示
*/
function redirect($sURL, $iTime, $sMsg = "") {
global $tpl;
$tpl->assign("sURL", $sURL);
$tpl->assign("iTime", $iTime);
$tpl->assign("sMSG", $sMsg);
$tpl->display("redirect.tpl.htm");
}

下面是redirect.tpl.htm页面的代码

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$__TITLE}</title>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK href="../templates/css.css" rel=stylesheet>
<META HTTP-EQUIV="Refresh" CONTENT="{$iTime};url={$sURL}">    
</head>
<body>

<br><br><br><br><br>
<table width="300" cellpadding="8" cellspacing="0" border="0" align="center">
<tr><td><br>

<table cellspacing="1" cellpadding="4" width="300" align="center" class="tableborder">

<tr class="header">
<td colspan="2">提示信息</td>
</tr>
<tr>
<td class="altbg1" align="center" valign="middle">
{if $iTime <= 3}
<img src="../templates/images/information.gif">
{* 成功 *}
{else}
<img src="../templates/images/warning.gif">
{/if}
</td>
<td class="altbg2"><span class="redFontBlod">{$sMSG}</span><br />系统将在{$iTime}秒返回到指定页面
<p>1.&nbsp;<a href="{$sURL}">立即返回到指定页面</a></p>
<p>2.&nbsp;<a href="./home.php">返回到首页</a></p>
</td>
</tr>

</table><br>
</td></tr>
</table><br>