[PHP] Re: User's language settings

2004-11-08 Thread Daniel Schierbeck
Dmitri Pissarenko wrote:
Hello!
I have a web-site, part of which is in Russian and another part in English.
English and Russian parts are located in different directories. The 
web-site is static.

I want to create a PHP file, which redirects the user from /index.php to 
/ru/index.html, when his primary language is Russian and to 
/en/index.html, when his primary language is non-Russian.

In other words:
?php
if ($languageRussian)
{
header(Location: http://dapissarenko.com/ru/index.html;);
}
else
{
header(Location: http://dapissarenko.com/en/index.html;);
}
exit;
?
How can I determine user's primary language?
Thanks!
dap
I don't think it's possible. You can, however, ask the user to select 
which language he wishes to see, then store that option in a cookie so 
he doesn't have to do it every time he visits the site.

--
Daniel Schierbeck
Help spread Firefox (www.getfirefox.com): 
http://www.spreadfirefox.com/?q=user/registerr=6584

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


RE: [PHP] Re: User's language settings

2004-11-08 Thread Zareef Ahmed
Hi,
  You may try a ip locator and then guess for users country.
IN this way you can design your programme to treat users from Russia to
Russian language etc.

Visit 
http://zareef.users.phpclasses.org/browse/package/1477.html 

Zareef Ahmed 


-Original Message-
From: Daniel Schierbeck [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 09, 2004 1:45 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: User's language settings


Dmitri Pissarenko wrote:
 Hello!
 
 I have a web-site, part of which is in Russian and another part in 
 English.
 
 English and Russian parts are located in different directories. The
 web-site is static.
 
 I want to create a PHP file, which redirects the user from /index.php 
 to
 /ru/index.html, when his primary language is Russian and to 
 /en/index.html, when his primary language is non-Russian.
 
 In other words:
 
 ?php
 
 if ($languageRussian)
 {
 header(Location: http://dapissarenko.com/ru/index.html;);
 }
 else
 {
 header(Location: http://dapissarenko.com/en/index.html;);
 }
 
 exit;
 ?
 
 How can I determine user's primary language?
 
 Thanks!
 
 dap
I don't think it's possible. You can, however, ask the user to select 
which language he wishes to see, then store that option in a cookie so 
he doesn't have to do it every time he visits the site.


-- 
Daniel Schierbeck

Help spread Firefox (www.getfirefox.com): 
http://www.spreadfirefox.com/?q=user/registerr=6584

-- 

--
Zareef Ahmed :: A PHP develoepr in Delhi ( India )
Homepage :: http://www.zasaifi.com

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