I am using this code:
setcookie("flash", "no", time() + (7 * 86400) , '/', 'thefaith.co.uk', 0);
$url = $_SERVER['HTTP_REFERER'];
header('Location: '.$url);
to set a cookie and then return the user to the page they were previosly using. However, I need to go back by two pages not one. I presume HTTP_REFERER is not the right thing to use for this, but can anyone tell me how I could, as the examples I have found all involve the user clicking a link.