#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Posts
    5
    Rep Power
    0

    getting clients country


    what is the easiest way to get the clients country, wthout asking them for it............is there a HTTP request?

    Thanks

    D6

    Comments on this post

    • Gran Roguismo agrees
  2. #2
  3. Second highest poster :p
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2001
    Posts
    7,322
    Rep Power
    33
    The IP addresses are a location-less protocol and so there is no sure way of finding out what country a user is from. The only you can maybe do it is to do a dns lookup on the ip address and get the country code from the domain but that is not very reliable.
    - Andreas Koepke

    Koepke Photography

  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Posts
    5
    Rep Power
    0
    yeah...i was hoping there was another way......
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2002
    Location
    Bavaria, Germany
    Posts
    140
    Rep Power
    12
    You can read out the HTTP Header "Accept Language". This field has a list of language codes prefered as a response to the request.

    See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.

    Example:

    Accept-Language: da, en-gb;q=0.8, en;q=0.7

    would mean: "I prefer Danish, but will accept British English and other types of English."
  8. #5
  9. No Profile Picture
    Just a kid
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2002
    Location
    Canada
    Posts
    105
    Rep Power
    13
    Or you could just get them to fill out a form.

    Comments on this post

    • Gran Roguismo agrees
    [ lavacube ]

    My Personal Site[greyDistortion]

    PHP version: 4.3.8
    MySQL version: 4.0.21
    Operating System (OS): SuSE Linux 9.1
    Apache version: 2.0.50

IMN logo majestic logo threadwatch logo seochat tools logo