PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sat Aug 15, 2020 6:30 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: PHP COOKIES!!
PostPosted: Mon Apr 07, 2008 1:20 pm 
Offline
Forum Newbie

Joined: Mon Apr 07, 2008 1:18 pm
Posts: 2
I need help hooking up a php cookie. I have tired many different options but can't get anything to work. I am trying to get setup the cookie to remember this pages login section. http://www.lknrealtygroup.com/searchForm2.php So, when the user goes back to the page later on in the day they don't have to fill it out it will take them straight to this page. http://www.lknrealtygroup.com/searchByArea.php Would love the help. Thanks.


Top
 Profile  
 
 Post subject: Re: PHP COOKIES!!
PostPosted: Mon Apr 07, 2008 1:51 pm 
Offline
Site Admin
User avatar

Joined: Tue Dec 23, 2003 3:10 am
Posts: 11470
Location: Toronto
What have you tried?

Have to looked at ?


Top
 Profile  
 
 Post subject: Re: PHP COOKIES!!
PostPosted: Mon Apr 07, 2008 1:56 pm 
Offline
Forum Newbie

Joined: Mon Apr 07, 2008 1:18 pm
Posts: 2
I have tired this

if (!isset($_COOKIE['lknCookie'])) {
// if a cookie does not exist
// set it
$hourdiff = "3"; $melbdate = date("l, d F Y h:i a",time() + ($hourdiff * 3600));
setcookie("lknCookie", "$melbdate", mktime()+86400*30, "/") or die("Could not set cookie");
$msg3 = "Cookie 3 Set.";
}
else {
// if a cookie already exists
$msg3 = "Cookie 3 Already Set";
}

No I have not yet tired setCookie();


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group