Refresh Page In PHP



In PHP sometimes you want to refresh the page you can do it by the javascript as well as by the PHP itself. Here I am going to refresh the page by using the "meta http-equiv".

index.html

<html>
<head>
<title>Page Refresh Test</title>
</head>
<body>
Page Refresh Test
<a href="index2.php"><strong>CLICK ME</strong></a> //Click the link for the page refresh test
</body>
</html>

In the above example I have linked a page named as index2.php, and there is the code for the index2.php page.

<?php
echo "Thank You for Reading the Blog.";
echo "You will be redirected to the previous page after (10) seconds.";
echo "<meta http-equiv=Refresh content=10;url=index.html>";
?>

Thats it, enjoy the page redirection in PHP.