note 23613 added to function.session-id

From: Date: Tue, 23 Jul 2002 20:26:21 +0000
Subject: note 23613 added to function.session-id
Groups: php.notes 
Request: Send a blank email to php-notes+get-33440@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"); -- http://www.php.net/manual/en/function.session-id.php http://master.php.net/manage/user-notes.php?action=edit+23613 http://master.php.net/manage/user-notes.php?action=delete+23613 http://master.php.net/manage/user-notes.php?action=reject+23613

« previous php.notes (#33440) next »