background image

PHP

教程 PHP 提交后跳转

本文是对 PHP 提交后跳转进行了详细的分析介绍,有兴趣的朋友参考下
代码如下: 
<?php

//========================== 定义 redirect() 

 

开始 =========================//

/**
* 定义 redirect()跳转函数,是用来在用户操作后,页面根据要求跳转到指定页面
*
* @param unknown_type $ms 是用来调整跳转所需要的秒数
* @param unknown_type $url 是指定跳转到的地址
* @param unknown_type $text 是显示跳转时候的信息
*/
function

 redirect(

$ms

 ='', 

$url

='', 

$text

=''){

echo

 <<<EOT

<meta http-equiv="refresh" content=

$ms

;URL=

$url

>

<div align="center">
<table width="600" border="0" cellpadding="1" cellspacing="1" 

class

="tableoutline">

<tr>
<td colspan="3"><table width="100%" border="0" cellpadding="5" cellspacing="1">
<tr>
<td valign="bottom"><div align="center">页面操作提示</div></td>
</tr>
<tr>
<td><div align="center">

$text

</div></td>

</tr>
<tr>
<td><div align="center"><a href="$url" mce_href="$url">

 

本页面在

$ms

 秒后自动跳转,如果

您的浏览器没有跳转,点此链接返回。</a></div>
</td>
</tr>
</table></td>
</tr>
</table>
</div>
EOT;
}