note 54772 added to ref.session

From: Date: Thu, 14 Jul 2005 17:10:07 +0000
Subject: note 54772 added to ref.session
Groups: php.notes 
Request: Send a blank email to php-notes+get-91977@lists.php.net to get a copy of this message
If you name a variable the same name as a $_SESSION array and initialize it from a $_REQUEST variable, the $_SESSION array will assume that value, too. Example: <? $_SESSION["alphabet"] = array('a', 'b', 'c'); var_dump($_SESSION["alphabet"]); // array(3) { [0]=> string(1) "a" [1]=> string(1) "b" [2]=> string(1) "c" } $alphabet = $_REQUEST['bleh']; //null var_dump($_SESSION["alphabet"]); // NULL ?> ---- Manual Page -- http://www.php.net/manual/en/ref.session.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+54772 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54772&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54772&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54772&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54772&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54772&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54772&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+54772&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#91977) next »