Home >Backend Development >PHP Problem >How to jump after a few seconds in php

How to jump after a few seconds in php

藏色散人
藏色散人Original
2020-11-01 14:17:372979browse

How to implement jump after a few seconds in php: First create a PHP sample file; then implement it through "header("refresh:5;url=http://www.XXXXX.com");" It will jump after a few seconds.

How to jump after a few seconds in php

Recommended: "PHP Video Tutorial"

Method one:

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

Method two:

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

The above is the detailed content of How to jump after a few 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