Page 1 of 1

Return to previous page

Posted: Sun Sep 21, 2008 11:35 pm
by phillyrob
Can some elaborate on setting this cookie. User Panic was nice enough to show me this but I do not understand and have not seen him online. This code should allow me go go back to a previous page after database query is done so the user does not have to search again, but I don't know where to put this code or how to use it.

if(!$_POST['query'] && $_COOKIE['query'])
{
$_POST['query']=$_COOKIE['query'];
}
else
{
setcookie('query',$_POST['query'],time()+3600,'/');
}

Re: Return to previous page

Posted: Mon Sep 22, 2008 2:52 pm
by califdon
http://us.php.net/setcookie should tell you what you need to know.