> -----Original Message-----
> From: Marc Guay [mailto:marc.g...@gmail.com]
> Sent: Wednesday, November 17, 2010 6:30 AM
> To: PHP General
> Subject: Re: [PHP] Updating a GET variable
> > 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...
> Hi Tommy,
> I read this at least 5 times and still don't quite get your meaning, but
> curious enough to ask:  Could you repeat in other words or give a short
> example?
> Marc


Nathan previously mention what if instead of a language specific request,
you have request for multiple languages.  I don't know if that's part of you
web app feature/service or not but you don't need session to process that
request unless you need the results for something else.  This example based
upon that you use URL query parameter to permit the users to change/select
the languages.  I don't know how your app is designed but you can process it
via $_POST also.

$languages = $_GET['lang']=en,de,fr;
$langArray = explode(',', $languages);  // you can use another separator
such as - or _

Than you can process for each of the language:

foreach ($langArray as $lang)
        process_request_func ($lang); 

<div id='lang_en'>results of process_request_func() for language en</div>
<div id='lang_de'>results of process_request_func() for language de</div>
<div id='lang_fr'>results of process_request_func() for language fr</div>

Or if you have jqueryui or something similar, use tabs for each of those
html content where  each language goes in its own tab.  If you need to save
the results for later use, then you'll need the session.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to