Resolve PHP to jump after submission

  • 2020-06-15 07:57:56
  • OfStack


<?php
//==========================  define redirect()  start  =========================//
/**
*  define redirect() Jump function, is used after the user action, the page according to the request to jump to the specified page 
*
* @param unknown_type $ms  Is used to adjust the number of seconds required to jump 
* @param unknown_type $url  Is the address to which the jump is specified 
* @param unknown_type $text  Displays the information at the time of the jump 
*/
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"> Page operation tips </div></td>
      </tr>
       <tr>
      <td><div align="center">$text</div></td>
      </tr>
       <tr>
      <td><div align="center"><a href="$url" mce_href="$url"> On this page  $ms  Automatically jumps after seconds, if your browser does not jump, click this link to return. </a></div>
   </td>
      </tr>
   </table></td>
</tr>
   </table>
   </div>
EOT;
}
//==========================  define redirect()  The end of the  =========================//
?>

When used:
redirect('2',' adduser. php',' add user has succeeded! Return later! ');
Where 2 represents the number of seconds, adduser.php is the page to jump to, "Added user has succeeded! Come back later!" Is the information displayed when the jump is waiting!

Related articles: