For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > April 2005 > setting $_SERVER['HTTP_ACCEPT_LANGUAGE']









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author setting $_SERVER['HTTP_ACCEPT_LANGUAGE']
Ike

2005-04-27, 3:56 am

IS there a way, in code, to SET

$_SERVER['HTTP_ACCEPT_LANGUAGE']

Or is it read-only?

-Ike


Ryan Heuser

2005-04-27, 3:56 am

Ike wrote:

> IS there a way, in code, to SET
>
> $_SERVER['HTTP_ACCEPT_LANGUAGE']
>
> Or is it read-only?
>
> -Ike


Why would you want to do that....

Peace,
Ryan Heuser
Kimmo Laine

2005-04-27, 3:56 am

"Ike" <rxv@hotmail.com> wrote in message
news:piBbe.13817$lP1.9430@newsread1.news.pas.earthlink.net...
> IS there a way, in code, to SET
>
> $_SERVER['HTTP_ACCEPT_LANGUAGE']
>
> Or is it read-only?
>


What's the purpouse of doing so? It will not affect the users capability of
recieving languages even if you did change it... You can't teach the user a
language by setting a variable. For me it would take several years to learn
Spanish for example. It's taken me a good 15 years to learn English and I
know I still make mistakes.

It seems your trying to achieve something else and doing it the wrong way.
What is exactly what you were trying to do by setting http_accept_language?

--
Welcome to Usenet! Please leave tolerance, understanding
and intelligence at the door. They aren't welcome here.
eternal piste erection miuku gmail piste com


Ike

2005-04-27, 8:56 am

Yes, you guys are right. Im reyting to allow the user to specify pages in
various languages, but I think I will go the cookie route for that, using as
the default, if it exists. Thanks, Ike

"Kimmo Laine" <eternal.erectionN05P@Mgmail.com> wrote in message
news:kxFbe.11567$Ch3.7632@reader1.news.jippii.net...
> "Ike" <rxv@hotmail.com> wrote in message
> news:piBbe.13817$lP1.9430@newsread1.news.pas.earthlink.net...
>
> What's the purpouse of doing so? It will not affect the users capability

of
> recieving languages even if you did change it... You can't teach the user

a
> language by setting a variable. For me it would take several years to

learn
> Spanish for example. It's taken me a good 15 years to learn English and I
> know I still make mistakes.
>
> It seems your trying to achieve something else and doing it the wrong way.
> What is exactly what you were trying to do by setting

http_accept_language?
>
> --
> Welcome to Usenet! Please leave tolerance, understanding
> and intelligence at the door. They aren't welcome here.
> eternal piste erection miuku gmail piste com
>
>



Kimmo Laine

2005-04-27, 3:56 pm

"Ike" <rxv@hotmail.com> kirjoitti
viestissä:MDJbe.49$BE3.41@newsread2.news.pas.earthlink.net...
> Yes, you guys are right. Im reyting to allow the user to specify pages in
> various languages, but I think I will go the cookie route for that, using
> as
> the default, if it exists. Thanks, Ike
>


Basicly that's the way to do it. You can only use
$_SERVER['HTTP_ACCEPT_LANGUAGE'] to detect what languages user supports, but
you can't save anything to it. If none of the languages you serve were found
in that, then use the default. If you find a match from languages you serve
/ what languages user supports, then write it to cookie or session. On
subsequent pages see what's inside the cookie / session and serve that
language, if none, then default.

--
"I am pro death penalty. That way people learn
their lesson for the next time." -- Britney Spears

eternal.erectionN0@5P4Mgmail.com


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com