if it doesn't involve alot, is it possible to redirect but to whichever page they came from? what am using now is header('Refresh: 3; URL=home.php');
it might be the case that they haven't come from home.php.
$back = $_SERVER['HTTP_REFERER']; echo '<meta http-equiv="refresh" content="0;URL='.$back.'">';
if you want to control where they go based on where they came from:
<?php $referer = $_SERVER['HTTP_REFERER']; switch $referer{ case "http://localhost/test2.php" : header("Location: http://www.example.com/num2.php"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; break; case "http://localhost/test3.php" : header("Location: http://www.example.com/home.php"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; break; case "http://localhost/test.php" : header("Location: http://www.example.com/doit.php"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; break; case "http://localhost/home.php" : header("Location: http://www.example.com/num7.php"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; break; default : header("Location: http://www.example.com/"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; break; } ?>
thnk aspekt9, is it possible to have a delay like so they can read a message before redirecting.
firemankurt, i didn't need your code but am sure it will come in handy later but thnx for replying.
its ok, i done it, i changed the 0 to the seconds of delay i wanted it
No problem, be sure to mark the thread 'Resolved' if you're all set.