Getting Locations From IP

Discussion in 'PHP' started by fireflyproject, Aug 10, 2007.

  1. #1
    In PHP, you can use the gethostbyaddr(); function to get the host address, which usually includes the city/state in a proprietary format, however I am curious to know if there is another way to pull city's and states.

    From what I understand, most services have a big database of all the hostnames, and it will check with that and then parse out the location in normal text, which seems pretty unreliable to me. Being that IP's change constantly that doesn't make a lot of sense to me, fairly inaccurate.
     
    fireflyproject, Aug 10, 2007 IP
  2. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
  3. longhornfreak

    longhornfreak Well-Known Member

    Messages:
    2,067
    Likes Received:
    95
    Best Answers:
    0
    Trophy Points:
    140
    #3
    longhornfreak, Aug 10, 2007 IP
  4. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #4
    fireflyproject, Aug 10, 2007 IP
  5. designerz

    designerz Banned

    Messages:
    669
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hey ...I was looking for such kind of a software...however I learnt this new code of PHP script from ur post. But in India there is no open IP for the individual users, so in that case, will it be easy to track individual location specifically?
     
    designerz, Aug 10, 2007 IP
  6. henryb

    henryb Member

    Messages:
    65
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #6
    I think you should start looking here

    http://www.maxmind.com/

    That's what most people seem to be using. There are free solutions as well, but as you said they are not so reliable.
     
    henryb, Aug 10, 2007 IP
  7. fireflyproject

    fireflyproject Active Member

    Messages:
    969
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    70
    #7
    I have this bookmarked, a friend sent me a link to it a bit ago. It seems that there might be an addition that you have to install with apache... which means most shared servers can't use this... maybe. I could be wrong about that.
     
    fireflyproject, Aug 10, 2007 IP
  8. henryb

    henryb Member

    Messages:
    65
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    43
    #8
    They have a pure php module. It should work on shared hosting as well. According to their website:

    http://www.maxmind.com/app/php

    The Pure PHP API is cross-platform, works on Windows as well as Linux, and does not require Apache, nor does it require the C API.
     
    henryb, Aug 10, 2007 IP