How to jump after staying for a few seconds in php

藏色散人
Release: 2023-03-08 19:54:01
Original
2830 people have browsed it

How to jump after staying for a few seconds in php: 1. Use "header("refresh:5;url=...");" to jump after staying for a few seconds; 2. Use "header("refresh:5;url=...");" setTimeout('myrefresh()',3000);" can be used to stay for a few seconds and then jump.

How to jump after staying for a few seconds in php

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

Stay in php for a few seconds and then jump Statement

Method one:

<?php
header("refresh:5;url=http://www.XXXXX.com");
print(&#39;正在加载,请稍等...<br>五秒后自动跳转。&#39;);
?>
Copy after login

Method two:

 <script language="JavaScript">
function myrefresh(){
window.location.href="<?php echo $url_web ?>";
}
setTimeout(&#39;myrefresh()&#39;,3000); //指定3秒转跳
</script>
Copy after login

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of How to jump after staying for a few seconds in php. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!