note 35314 added to function.setcookie

From: Date: Wed, 27 Aug 2003 11:47:39 +0000
Subject: note 35314 added to function.setcookie
Groups: php.notes 
Request: Send a blank email to php-notes+get-55169@lists.php.net to get a copy of this message
/* an easy way to set a cookie from a form */ setcookie("login_user","$un",time()+3600); setcookie("login_pass","$pw",time()+3600); /* what most people think is they have to echo the varyable, in this case, the varyable is $un and $pw, you should, you have to echo the name, in this case its login_user and login_pass, but you have to echo it as a varyable for it to work */ echo ("$login_user"); /* thats the example, it works, that i made the same mistake, ita taken me 2 month to learn that, lol, slow learner :) */ ---- Manual Page -- http://www.php.net/manual/en/function.setcookie.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35314 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35314&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35314&report=yes

« previous php.notes (#55169) next »