How to Auto Refresh webpage every 5 seconds in PHP?

Published on July 7, 2013 by admin

Filed under PHP

Last modified July 7, 2013

Print this page

rate 1 star rate 2 star rate 3 star rate 4 star rate 5 star
Your rating: none, Average: 1.7 (10 votes)

This article have been viewed 44970 times

Below is a sample code demonstrating how to refresh the webpage automatically every 5 seconds in PHP.

How to Auto Refresh webpage every 5 seconds in PHP?



header("Refresh: 5; URL=$url1");



  1. longdy

    i have problem FormValidator last click oclin button update but me click on button save update a gan it not validate

    December 25, 2014 - 8:45 am – Reply

  2. Adam

    Hi i think i can use this for a problem i have….
    I need to find a way to get a page refresh IF a string is empty..
    IF $mystring = “” THEN ?

    How can i rewrite your code?

    Thanks for your time

    March 27, 2016 - 9:51 am – Reply

  3. Wasef Dhiman

    header(“Refresh: 5; URL=$url1”);

    Try this bro. 🙂

    July 4, 2016 - 3:37 am – Reply

    • Kumar

      Sure 🙂

      July 5, 2016 - 7:38 pm – Reply

Leave a Comment


You might be Interested in these Posts

How to Download Web Content synchronously in C# ?

If you need to download the web content synchronously using C# , you can use the WebClient class tha...

PHP Code Refactoring Tools

Here's a list of some of the Refactoring tools for the PHP developers. PHP Code Refactoring Tools...

Best and Free PHP based eCommerce CMS (Content Management System)

There are plenty of PHP based eCommerce CMS solutions that are available and in this article, we lis...