...

View Full Version : cookies



gerbera
12-20-2010, 09:59 PM
Does anyone know how to have a cookie remember the previous page the viewer was viewing (url), so I can redirect them back there?

jmace
12-21-2010, 12:12 AM
You could just use:

header("Location: ".$_SERVER['HTTP_REFERER'])
Then there is no need for a cookie.

EDIT:
Or if you need one, you can use:

<?php
setcookie("RefererCookie", $_SERVER['HTTP_REFERER']);
echo $_COOKIE["RefererCookie"];
?>

dwspro
12-21-2010, 09:50 AM
thanks Jmace!
I think it may help!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum