note 23613 deleted from function.session-id by sniper

From: Date: Wed, 05 Feb 2003 00:13:07 +0000
Subject: note 23613 deleted from function.session-id by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-43422@lists.php.net to get a copy of this message
To megadesty@gmx.de and others: There is no bug in IE6! If you register the variable in a function, session_register will not reg it, because the variable isn't in the global scope. Read this: "...session_register()... This registers a global variable. If you want to register a session variable inside a function, you need to make sure to make it global using global() ..." Source: http://www.php.net/manual/en/function.session-register.php I.e.: ******************** session_start(); ... //a little bit more code ... //get from DB or anything global $user_name, $user_url; $user_name = "Zeljko"; $user_url = "http://www.zeltru-design.de "; session_register("user_name", "user_url"); ******************** It works fine on Win- & Linux-Server. I think it works with $_SESSION[...] fine, too! sincerely Zeljko ***$CLEAR_CODE->write("you");

« previous php.notes (#43422) next »