little confusion about session_register()

From: Date: Fri, 04 Aug 2000 10:42:13 +0000
Subject: little confusion about session_register()
Groups: php.general 
Request: Send a blank email to php-general+get-10110@lists.php.net to get a copy of this message
Hi, I have the following code fragment: session_start(); session_register( "id" ); if( empty( $HTTP_SESSION_VARS["id"] ) ) { $HTTP_SESSION_VARS["id"] = "foo"; print "new"; } else { print "old"; } The problem is now that I'm getting always "new" printed, but never "old". The following version works fine: session_start(); session_register( "id" ); if( empty( $id ) ) { $id = "foo"; print "new"; } else { print "old"; } The point is that I want to avoid global variables here, as used in the second - working - example. -- <?php $a=explode(" " ,"119 130 128 129 45 110 123 124 129 117 114 127 45 ". "125 117 125 45 117 110 112 120 114 127");for($i=0;$i<sizeof($a);$i++)print chr($a[$i]-13);// http://gravedancer.rc5.de/ | sebastian.bergmann@web.de ?>

« previous php.general (#10110) next »