On Tue, October 17, 2006 1:13 am, John Taylor-Johnston wrote:
> This is what http_accept_language gives me depending on which browser.
> Depending on the visitor in my region, it will either be French or
> English.
>
> _SERVER["HTTP_ACCEPT_LANGUAGE"] en-us,en;q=0.8,fr;q=0.5,fr-ca;q=0.3
> _SERVER["HTTP_ACCEPT_LANGUAGE"] fr-ca,en-us;q=0.5
>
>
> Is this a reasonable approach?
>
> if(stristr($_SERVER["HTTP_HOST"],"fr"))
> { include("french.htm");}else{ include("english.htm");}

Yes, but you still need to give me the little link flags to get to the
English version, for when I'm in Paris at some Internet Cafe...

Cuz being in Paris and using a French keyboard and a French browser
didn't improve my French language skills as all :-(

So you'll probably want to use the ACCEPT_LANGUAGE stuff only if the
user has not previously selected their own option of language -- and
then store it in $_SESSION once they have selected, so you can
"remember" who doesn't speak French, no matter what their browser
might be telling you.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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

Reply via email to