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

How to control page jump in php

王林
王林Original
2020-08-04 11:45:212338browse

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")
?>

(Video Tutorial recommendation: php video tutorial)

Automatically jump after 1 second

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

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

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

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!

Statement:
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