RE: [PHP] Updating a GET variable
| From: | Tommy Pham | Date: | Wed, 17 Nov 2010 02:00:16 +0000 |
| Subject: | RE: [PHP] Updating a GET variable | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-309527@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Nathan Rixham [mailto:nrixham@gmail.com]
> Sent: Thursday, November 11, 2010 8:18 AM
> To: Marc Guay
> Cc: Tamara Temple; PHP General
> Subject: Re: [PHP] Updating a GET variable
>
> Marc Guay wrote:
> >> So all you need to do, is take a look at
> >> $_SERVER['HTTP_ACCEPT_LANGUAGE'] to get a users language
> preferences.
> >
> > Hi Nathan,
> >
> > Yep, I'm using this var to set the default but I think it's nice to
> > allow the user to override it. Maybe someone using their computer is
> > more comfortable in a different language?
>
> So then surely that would be their default language?
>
> However, there is of course the case where somebody wants to see both
> english and german variations of the "same" page, so probabyl a good use-
> case after all - session to the rescue!
>
A bit late in the thread. However, IMO, I don't think session is necessary,
unless you intend to save it for later use, during that same visit from the
user. If it's just a 1 time request, you can just use (example)
$_GET['lang']=en,de,fr,...
Then just split up individual languages, process the request of each
supported language, and place each relevant localization in its own tab
panel, div (non js), etc...
Regards,
Tommy