www.webdeveloper.com
Results 1 to 6 of 6

Thread: How to determine the location of visitor?

  1. #1
    Join Date
    Jan 2010
    Location
    Belgium
    Posts
    319

    How to determine the location of visitor?

    Hello,

    I hope this is the correct forum to post this topic.

    I wonder how to determine the location of a visitor. Sometimes I see some kind of ads like 'Chat with other members from Zwijndrecht' (a location nearby, perhaps my Internet Providor servers location) on a website where I don't even subscribed.

    So is there some kind of range of IP addresses by country with the locations or ...

    I hope somebody can answer this question

    Christophe

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    18,933
    This is done by comparing the IP address of the HTTP request to an IP-to-location database (see the $_SERVER['REMOTE_ADDR'] super-global variable). You can google on something like "IP geolocation database" to find what is currently available.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Jan 2010
    Location
    Belgium
    Posts
    319
    Ok, thank you. I'll look at that

  4. #4
    Join Date
    Jan 2010
    Location
    Great Britian
    Posts
    21
    You can not tell a persons location by the IP address alone.

    My internet connection ALWAYS says I am in Birmingham when the fact is I am more than a 2 hour drive away in another city.

    People putting faith in this GeoIP thing are wasting time and effort on something that has never been accurate at all. Until the time were all running on IPv6, this GeoIP location thing WILL NEVER WORK.

    I have been with several ISP's in as many years, when I was with BT-Yahoo, my internet connection always showed me as being an american connection in NY. When I was with BT-Broadband, my connection again showed me up as being an american connection. When I was with Ntl, my connection always showed up as a London connection.

    This current ISP that I have shows me being a connection in Birmingham.

    I do live in the midlands, UK but I don't live in Birmingham, never lived in london, never set foot in the USA... SO why is something that people put so much faith in being accurate so wrong?

    IMHO wait for IPv6 to be fully implemented until you throw all your money in to the GeoIP basket.

  5. #5
    Join Date
    Nov 2008
    Posts
    2,477
    Well, currently GeoIP location is the only thing to go on (and although it is rarely very accurate to the city, I've found it to be largely accurate on the country level), so saying "wait for IPv6" isn't really a solution. Something like the GeoIP Lite database for example is 99.5% accurate which is infinitely better than the 0% you get from doing nothing.

  6. #6
    Join Date
    Jan 2010
    Location
    Belgium
    Posts
    319
    Hi,

    Thank you for all your kind replies!

    If the location is accurate by country, it is good engough for me ;-)

    Thx!
    Christophe

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles