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

Do you want to redirect the website after a certain amount of time or Page redirect after a 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 concepts to redirect a page after some time. These functions also allow changing delay time.

How To Redirect If JavaScript Is Disabled In A Browser

Let’s see a snippet to get it better.

Redirect using PHP.

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

Redirect using JavaScript.  

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

Redirect Using Meta Tag

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

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

Leave a Comment