Global Variable Change
| From: | Thomas Brodkorb | Date: | Fri, 01 Mar 2002 13:48:41 +0000 |
| Subject: | Global Variable Change | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-86765@lists.php.net to get a copy of this message | ||
Hi folks,
small problem with globals:
I would like to set a variable global called "Language".
This seems to be not a really problem, but it is.
Index.php:
<?php {
session_start();
if (!session_is_registered('Language')) {
session_register('Language');
$Language = 1031;
}
...
?>
But all other pages do not have really access to this variable without
calling "start_session()" from within the other pages().
If I call, it works.
Now the real problem.
I would like to set $Language by an Hyperlink with image hyperlinks, but it
doesnt change anything.
Within the hyperlink I call "setlanguage.php?lang=1033"
<?php {
session_start();
if ( ($lang <> "1031") and ($lang <> "1033") ) {
$lang= "1031"; }
$Language = $lang;
if (session_is_registered('Language')) {
session_unregister('Language');
}
session_register('Language');
} ?>
But it doesnt change ANYTHING !!!!
Please Help
Thomas