I have set my PHP page to refresh and get values from the database , the problem is that it goes blank after sometimes. The refreshing part and everything works fine. Only thing is that the page goes blank
Code i used for refreshing the page is:
$url=$_SERVER['REQUEST_URI'];
header("Refresh: 1; URL=$url")
Place an iframe which calls your page to refresh inside a static page. Then refresh this iframe every second. Using this pattern it breaks not the functionality when the dynamic page returns blank once.
Simple Example
<html>
<script>
setInterval("reload()", 2000);
function reload(){
document.getElementById('refresh').src = "./page_to_refresh.php";
}
</script>
<iframe id="refresh" src="./page_to_refresh.php">
</html>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.