Return to previous page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phillyrob
Forum Commoner
Posts: 34
Joined: Wed Jun 18, 2008 12:00 am

Return to previous page

Post 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,'/');
}
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: Return to previous page

Post by califdon »

http://us.php.net/setcookie should tell you what you need to know.
Post Reply