note 29018 deleted from function.setcookie by tularis
| From: | tularis@php.net | Date: | Sun, 02 Jan 2005 14:27:58 +0000 |
| Subject: | note 29018 deleted from function.setcookie by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-82600@lists.php.net to get a copy of this message | ||
Note Submitter: peterg at NOSPAM dot mildewhall dot com
----
I cookified my Nokia 6310i !
This must come before any WAP headers:
<?php
if ( $_COOKIE["LV"] )
{
setcookie ("LV", "", time() - 3600); // destroy old cookie
setcookie ("LV", date ("l dS of F Y h:i:s A"),time()+3600); //
"update" by adding a new one
}
else
{
setcookie ("LV", date ("l dS of F Y h:i:s A"),time()+3600); // add a new
cookie
}
... and then when you actually want to read it, stick this somewhere in your card deck:
<?php if ($_COOKIE["LV"]) echo "Last visit " . $_COOKIE["LV"] .
"<br/>"; ?>