Forum Moderators: coopster

Message Too Old, No Replies

Browser location variable

         

PeteM

12:09 pm on Nov 12, 2004 (gmt 0)

10+ Year Member



Is there a PHP variable that provides the location of the browser (e.g. US, UK, etc)?

baertyp

3:22 pm on Nov 12, 2004 (gmt 0)

10+ Year Member



No, afaik there isn't. You can parse $_SERVER['HTTP_ACCEPT_LANGUAGE'], and maybe some other hints in $_SERVER[], but being sent from the client this unfortunately is unreliable information.

Still that's about the most you can get without geocoding the IP address.

Regards
Markus

coopster

3:57 pm on Nov 12, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Or you could ask them the location and store it in a cookie.

PeteM

5:29 pm on Nov 12, 2004 (gmt 0)

10+ Year Member



Thanks guys.