Home > Backend Development > PHP Problem > How to control page jump in php

How to control page jump in php

王林
Release: 2023-03-03 18:42:02
Original
2339 people have browsed it

How to control page jump in php: Control page jump by using header("Refersh: seconds; url=address"). For example, to achieve automatic jump after 3 seconds, the specific method is: [header("Refresh:3;url=helloworld.php")].

How to control page jump in php

php automatically refreshes the current page after a certain delay and automatically jumps to the header ("Refresh: seconds; url=address").

(Recommended tutorial: php graphic tutorial)

Example:

Automatically jump after 3 seconds

<?php   
    header("Refresh:3;url=helloworld.php")
?>
Copy after login

(Video Tutorial recommendation: php video tutorial)

Automatically jump after 1 second

header("refresh:1;url={$url}");exit;
Copy after login

Call the sleep() method, the effect is also to execute the jump after x seconds

<?php 
    sleep(3); 
    header("location:url地址")
?>
Copy after login

The above is the detailed content of How to control page jump 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