Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php refresh

//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");
Comment

php refresh page

header("Refresh:0");
Comment

auto refresh page in php

<html>
 <head>

  <meta http-equiv="refresh" content="10; url="<?php echo $_SERVER['PHP_SELF']; ?>">
 </head>
 <body>

 </body>
</html>
Comment

php refresh page without reloading

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);
        }
    }
});
Comment

PREVIOUS NEXT
Code Example
Php :: behamin bresource collection 
Php :: php to string 
Php :: laravel model transaction 
Php :: magento 2 status mode 
Php :: change laravel mix to run on different port 
Php :: yii1 set flash 
Php :: php milliseconds 
Php :: laravel default websie ar 
Php :: php create 404 error 
Php :: print query in laravel 
Php :: get last two numbers from int php 
Php :: php grab month from date 
Php :: wordpress echo the page title 
Php :: php artisan make controller model and migration 
Php :: doctrine php driver execption 
Php :: constructor in php 
Php :: laravel fillable 
Php :: debug query in moodle 
Php :: how to switch from php7.4 to php7.3 mac 
Php :: how to take last entry in database in laravel Method Three 
Php :: laravel migration on delete set null 
Php :: $posts- links() laravel design error 
Php :: laravel word count utf8 
Php :: php number format spaces 
Php :: how to send html tags in twig template 
Php :: acf repeater example count 
Php :: laravel deployment 
Php :: php parse xml 
Php :: change php version in ubuntu 
Php :: check php version linux terminal 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =