note 60738 added to function.setcookie
| From: | NEWATPHPDOTTECH at osu1 dot php dot net | Date: | Sun, 15 Jan 2006 16:35:41 +0000 |
| Subject: | note 60738 added to function.setcookie | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-101854@lists.php.net to get a copy of this message | ||
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?
----
Manual Page -- http://www.php.net/manual/en/function.setcookie.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60738
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60738&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60738&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60738&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60738&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60738&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60738&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60738&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60738&report=yes
Search -- http://master.php.net/manage/user-notes.php