How to implement jump after submission in php?

coldplay.xixi
Release: 2023-03-02 16:12:02
Original
2867 people have browsed it

How to implement jump after submission in php: first define the [redirect()] jump function; then adjust the number of seconds required for the jump and specify the address to jump to. The code is [function redirect($ms ='', $url='', $text='')].

How to implement jump after submission in php?

php method to implement jump after submission:

First define the [redirect()] jump function, This function is used to jump to the specified page according to the requirements after the user operates; then adjust the number of seconds required for the jump and specify the address to jump to.

<?php
/**
* 定义redirect()跳转函数,是用来在用户操作后,页面根据要求跳转到指定页面
*
* @param unknown_type $ms 是用来调整跳转所需要的秒数
* @param unknown_type $url 是指定跳转到的地址
* @param unknown_type $text 是显示跳转时候的信息
*/
function redirect($ms =&#39;&#39;, $url=&#39;&#39;, $text=&#39;&#39;){
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;
}
?>
Copy after login

Related learning recommendations: PHP programming from entry to proficiency

The above is the detailed content of How to implement jump after submission in php?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!