RE: [PHP] Quickie
| From: | John W. Holmes | Date: | Mon, 30 Sep 2002 16:51:13 +0000 |
| Subject: | RE: [PHP] Quickie | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-118233@lists.php.net to get a copy of this message | ||
> John W. Holmes propably said:
>
> > Is register globals on or off?
>
> On.
>
> Now - without doing anything - i managed to change the value of $lang
to
> 'en' with a link (pagesname.php?lang=en). But i can't change it back
with
> ?lang=se. Should i get someting to eat to get my brain working?
Here's the problem with register globals. If you pass $lang in the url,
it's a get variable. But when you call session_start, $lang is being
overwritten with the $lang from the session. So you're not changing it.
Try passing a $change_to_lang=en, and then
If(isset($change_to_lang)) { $lang = $change_to_lang; }
Hope that helps.
---John Holmes...