note 60738 deleted from function.setcookie by betz
| From: | betz@php.net | Date: | Sun, 15 Jan 2006 17:10:31 +0000 |
| Subject: | note 60738 deleted from function.setcookie by betz | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-101855@lists.php.net to get a copy of this message | ||
Note Submitter: NEW AT PHP DOT TECH
----
hello everybody,,
i'm not much of an expert in PHP, but what do you guys think of this one:
<?php
// tell the script if $_GET is "out" then DELETE cookie
if(isset($do) && $do == out){
setcookie('COOKIESNAME');
}
// tell the script if $_GET is "in" then SET cookie
if($_GET['do'] == "in"){
setcookie('COOKIESNAME','world',time()+3600);
ECHO "HEY, WELCOME YOU ..IN..";
}
if($_GET['do'] == "out"){
ECHO "THANKS, VISIT AGAIN SOMETIME";
}
?>
Would it work to add and delete cookies ""SAFELY"" and easly?