php method to refresh the page to be jumped: first open the corresponding PHP page code; then implement the jump through the header; finally through "header('refresh:3; url=index.php') ;" Just implement the jump and refresh.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
php refreshes the page to be jumped
The code is as follows:
PHP page jump:
// 只是跳转,所以一定要用die();或者exit;终止下一步操作; header('location:index.php'); exit; // 等待3秒,跳转并刷新 header('refresh:3; url=index.php');
Related introduction:
header() function sends the original HTTP header to the client.
It's important to realize that the header() function must be called before any actual output is sent (in PHP 4 and above, you can use output caching to solve this problem):
<html> <?php // 结果出错 // 在调用 header() 之前已存在输出 header('Location: http://www.example.com/'); ?>
Grammar
header(string,replace,http_response_code)
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of PHP realizes that the page to be jumped is refreshed once. For more information, please follow other related articles on the PHP Chinese website!