note 29018 added to function.setcookie

From: Date: Thu, 30 Jan 2003 15:20:10 +0000
Subject: note 29018 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-43134@lists.php.net to get a copy of this message
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/>"; ?> -- http://www.php.net/manual/en/function.setcookie.php http://master.php.net/manage/user-notes.php?action=edit+29018 http://master.php.net/manage/user-notes.php?action=delete+29018 http://master.php.net/manage/user-notes.php?action=reject+29018

« previous php.notes (#43134) next »