Redirect Page after Certain Time using PHP, JavaScript or META Tag

Redirect Page after Certain Time using PHP, JavaScript or META Tag

Do you want to Redirect website after certain amount of time or Page redirect after certain time PHP.

In this tutorial, we will see how to redirect a page after 5 seconds using PHP, JavaScript and Meta tags.

Here are some basic concept to redirect a page after some time. These function also allow to change delay time.

How To Redirect If JavaScript Is Disabled In A Browser

Let’s see snippet to get it better.

Redirect using PHP.

<?php
header( "refresh:5;url=http://www.phpcluster.com" );
?>

Redirect using JavaScript.  

<script type="text/javascript">
 setTimeout(function(){
     window.location="http://www.phpcluster.com";
   },5000);
</script> 

Redirect Using Meta Tag

<meta http-equiv="refresh" content="5;url=http://www.phpcluster.com"> 

Hope you have learned how to Redirect a page after a few seconds using PHP JavaScript and meta tags. If you have any query feel free to comment.

Leave a Reply

Your email address will not be published. Required fields are marked *