Page 1 of 1

Where is the visitor from?

Posted: Sat May 19, 2007 7:58 am
by sentback
How can I know where the visitor of the page is from? I need this to define the language in which the page will be displayed in. Thanks

Posted: Sat May 19, 2007 8:10 am
by feyd
$_SERVER often contains their accepted language information.

Posted: Sat May 19, 2007 8:37 am
by sentback
Thanks feyd! Didn't know about that one :D I'll use $_SERVER['HTTP_ACCEPT_LANGUAGE'] and search for language in it. Hope it'll work :P

Posted: Sat May 19, 2007 3:16 pm
by Kieran Huggins
You can also use a geo-location-by-IP webservice or database to locate a user. There are some free ones that are OK and some that you have to pay for. Google will help you decide which is better for your application / pocketbook.

As for language, feyd's suggestion is right on the money.