Re: Updating a GET variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tamara Temple wrote:

On Nov 10, 2010, at 8:58 AM, Marc Guay wrote:

foreach($_GET as $k => $v) $qs[$k] = URLDecode($v);
$qs['lang'] = 'en';
echo '<a href="index.php?'.http_build_query($qa).'">Flip</a>';

Hi Tamara,

Thanks for the tips.  Do you see any advantage of this method over
using a small POST form besides the styling problems I'll run into
trying to make the submit button look like an achor?

The main advantage I see is that you're application doesn't have to become bi-modal, with looking for variables on both the query string and in the post data, then deciding which to use.

All browsers send the Accept-Language header from the users locale settings, like:

  "Accept-Language:en-GB,en-US;q=0.8,en;q=0.6"

So all you need to do, is take a look at $_SERVER['HTTP_ACCEPT_LANGUAGE'] to get a users language preferences.

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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux