";" statement."/> ";" statement.">

Home  >  Article  >  Backend Development  >  How to achieve page jump in 3 seconds in php

How to achieve page jump in 3 seconds in php

青灯夜游
青灯夜游Original
2021-11-11 18:29:519246browse

How to achieve page jump in 3 seconds in php: 1. Use the "header('Refresh:3,Url=page address')" statement; 2. Use "echo "";" statement.

How to achieve page jump in 3 seconds in php

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

php achieves 3 seconds How to jump to the page

1. Use Header function

<?php
header("Content-type:text/html;charset=utf-8");
header(&#39;Refresh:3,Url=http://www.php.cn/&#39;);   //3s后跳转
echo &#39;3s 后跳转&#39;;
//由于只是普通页面展示,提示的样式容易定制
die;
?>

How to achieve page jump in 3 seconds in php

2. Use echo outputs meta

<?php
header("Content-type:text/html;charset=utf-8");
echo &#39;3s 后跳转&#39;;
echo "<meta http-equiv=&#39;refresh&#39; content=&#39;3; url=http://www.php.cn&#39;>";
die;
?>

How to achieve page jump in 3 seconds in php

Note that the number 3 in the content means how long it will take to start jumping. The setting here is 3, which means it will take It will take 3 seconds for the page to jump to the target page. It is recommended that you set the jump time not to exceed 10 seconds.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to achieve page jump in 3 seconds 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