How can I make a redirect with PHP after say 10 seconds...
I have read alot about it, seems like it would be better with javascript. But PHP would save me alot of co
I managed to do it with a simple function on PHP
function RedirectToURL($url, $waitmsg = 0.4)
{
header("Refresh:$waitmsg; URL= $url");
exit;
}
and you call from your PHP for waiting 2 seconds before redirect. Note that $waitmsg = 0.4 is used for defining the default value.
RedirectToURL("http://website.php", 2);
If you want to redirect after a form submit, you can try
if(isset($_POST['submitted']))
{
echo '
Sucess. Thanks for contribution.';
RedirectToURL("http://thewebsiteilookforaftersubmit", 2); // I want to wait 2 seconds and not 0.4 as defined by default
}