Home > Article > Backend Development > How to implement jump after submission in php?
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='')].
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 ='', $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; } ?>
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!