加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > PHP > 正文

解析PHP提交后跳转

发布时间:2020-05-24 14:26:05 所属栏目:PHP 来源:互联网
导读:本篇文章是对PHP提交后跳转进行了详细的分析介绍,需要的朋友参考下

<div class="codetitle"><a style="CURSOR: pointer" data="79259" class="copybut" id="copybut79259" onclick="doCopy('code79259')"> 代码如下:<div class="codebody" id="code79259">
<?php

//========================== <FONT style="COLOR: #ff0000">定义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">页面操作提示</td>
</tr>
<tr>
<td><div align="center">$text</td>
</tr>
<tr>
<td><div align="center"><a href="$url" mce_href="$url">本页面在 $ms 秒后自动跳转,如果您的浏览器没有跳转,点此链接返回。
</td>
</tr>
</table></td>
</tr>
</table>

EOT;
}

//========================== <FONT style="COLOR: #ff0000">定义redirect() 结束 =========================//

?>

<FONT style="COLOR: #ff0000">使用的时候是:

redirect('2','adduser.php','增加用户已经成功!稍后返回!');
其中 2 表示秒数,adduser.php 是所跳转的页面, "增加用户已经成功!稍后返回!" 是跳转等待的时候所显示的信息!

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读