Answered by : gifted-grouse-jx1xe5jxtl7p
//refreshes your current page
header("Refresh:0");
//refreshes your current page after 5 seconds
header("Refresh:5");
//If you need to redirect it to another page
header("Refresh:0; url=page2.php");
Source : | Last Update : Thu, 15 Oct 20
Answered by : aashit-vyom
//Refreshes your current page
header("Refresh:0");
header("Refresh:2"); // Refreshes after 2 seconds
//If you need to redirect it to another page
header("Refresh:0; url=page2.php");
Source : https://stackoverflow.com/questions/12383371/refresh-a-page-using-php | Last Update : Wed, 20 May 20
Answered by : adcamtre
header("Refresh:0");
Source : https://stackoverflow.com/questions/12383371/refresh-a-page-using-php | Last Update : Mon, 23 Mar 20
Answered by : tc-mohd-amin-hassan
<html> <head> <meta http-equiv="refresh" content="10; url="<?php echo $_SERVER['PHP_SELF']; ?>"> </head> <body> </body>
</html>
Source : https://stackoverflow.com/questions/11497611/php-auto-refreshing-page | Last Update : Fri, 19 Aug 22
Answered by : enchanting-eel-pvs6mr3i3q9a
header("Refresh:0");
header("Refresh:0; url=page2.php");
Source : | Last Update : Mon, 12 Oct 20
Answered by : enrico-bisco
window.addEventListener('load', function()
{ var xhr = null; getXmlHttpRequestObject = function() { if(!xhr) { // Create a new XMLHttpRequest object xhr = new XMLHttpRequest(); } return xhr; }; updateLiveData = function() { var now = new Date(); // Date string is appended as a query with live data // for not to use the cached version var url = 'livefeed.txt?' + now.getTime(); xhr = getXmlHttpRequestObject(); xhr.onreadystatechange = evenHandler; // asynchronous requests xhr.open("GET", url, true); // Send the request over the network xhr.send(null); }; updateLiveData(); function evenHandler() { // Check response is ready or not if(xhr.readyState == 4 && xhr.status == 200) { dataDiv = document.getElementById('liveData'); // Set current data text dataDiv.innerHTML = xhr.responseText; // Update the live data every 1 sec setTimeout(updateLiveData(), 1000); } }
});
Source : https://stackoverflow.com/questions/22577457/update-data-on-a-page-without-refreshing | Last Update : Wed, 17 Feb 21
Answered by : anxious-antelope-j7ongaam8ozd
<?php
$page = $_SERVER['PHP_SELF'];
$sec = "10";
?>
<html> <head> <meta http-equiv="refresh" content="<?php echo $sec?>;URL='<?php echo $page?>'"> </head> <body> <?php echo "Watch the page reload itself in 10 second!"; ?> </body>
</html>
Source : https://stackoverflow.com/questions/11497611/php-auto-refreshing-page | Last Update : Sat, 23 Apr 22