Redirection after some time delay in php


In this programming tutorial we will learn how to perform redirection after some time delay in php. I have already written tutorials for same topic in javascript and asp.net. It is quite easy in php. I will demonstrate this with two methods. So let's have a look over how to do so.

Redirection after some time delay in php


Use Header Function
header("refresh:5;url=somepage.php");
Note:- If your php page also contains html code then use header function on very top of the page just before the <head> tag else you will get the headers already sent by... error.

Use Meta tag in echo or print statement
print "<meta http-equiv='refresh' content='5;url=somepage.php'>";

So that's it. I hope you will find this tutorial very handy.

I love your feedback

0 comments: