Sounds like you know what to do already. If you want to store the URLs in a database, that's fine, but just imagine you've got a structure like this:
<?PHP
$routes = array(
'example.com/1.php'=>'example.com/2.php',
'example.com/2.php'=>'example.com/3.php',
'example.com/3.php'=>'example.com/4.php');
if (array_key_exists($_SERVER['HTTP_REFERER'],$routes)){
header('Location: http://'. $routes[$_SERVER['HTTP_REFERER']]);
}else{
header('Location: http://example.com/default.php');
}
exit;
?>
timdev
2009-09-14 20:08:28