With register_globals off, ordinary GLOBAL variables can't be registered, so
the line "session_register("language");" isn't doing anything. Access all
registered variables through $HTTP_SESSION_VARS only.
Kirk
> -----Original Message-----
> From: Christian Ribeaud [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 14, 2001 1:38 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] [Win32,PHP/4.0.5] Problem with session
>
>
> Hi,
>
> I would like to know what is wrong with the code below.
> The following code will be included on every page with the include
> command.
> The variable $language does not seem to be registered at all.
> it should
> be registered
> again on every page. Why this? On the php.ini
> register_globals is "off"
> and session.auto_start is "0".
> Any help would be gratefully appreciated. Thanks and have a nice day,
>
> christian
>
> -------------------------------- code --------------------------------
> session_name("Apache");
> if (apache_note("Cookie")) {
> session_id(apache_note("Cookie"));
> }
> session_start();
> if (session_is_registered("language")) {
> $language = ($HTTP_GET_VARS["language"])?
> $HTTP_GET_VARS["language"]:
> $HTTP_SESSION_VARS["language"];
> } else {
> session_register("language");
> $language = $HTTP_GET_VARS["language"]?
> $HTTP_GET_VARS["language"]:
> "d";
> }
> $HTTP_SESSION_VARS["language"] = $language;
> -------------------------------- code --------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]