IP-to-Country converter (php script)

Discussion in 'PHP' started by ablaye, Jun 16, 2006.

  1. #1
    Hi,

    I am looking for a PHP script that can take an ip address and return the country where that ip address belongs to.
    If you know or have been using such a script, please let me know.

    Thanks
     
    ablaye, Jun 16, 2006 IP
  2. xeno

    xeno Peon

    Messages:
    788
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I am too. Willing to pay (a little bit) for it. I think you have to use web services for it though.
     
    xeno, Jun 17, 2006 IP
  3. falcondriver

    falcondriver Well-Known Member

    Messages:
    963
    Likes Received:
    47
    Best Answers:
    0
    Trophy Points:
    145
    #3
    you need a database to do this. afaik you can only "rent" this database (this means its an online service and you get an api to send a query to another server) per year. i think i have seen this services between 49/year (just ip to country) up to 1000/year or so (ip to country, city, street + geo coords so that you can display it on a map, calculate distances and so on).
    i found this free db here:
    http://www.maxmind.com/app/geoip_country
    or go and search for "geo ip".

    however, this results are easy to fake (proxy, or if you dial-in to your isp via cellphone) and far away from accurate. found my own location in the middle of an lake 30km away sometimes with this kind of tools.
     
    falcondriver, Jun 17, 2006 IP
  4. Chemo

    Chemo Peon

    Messages:
    146
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Let me see what I can find in my archives...

    I implemented this feature on an osCommerce store so that when a customer created an account the country drop down menu was pre-selected.

    Bobby
     
    Chemo, Jun 17, 2006 IP
  5. Chemo

    Chemo Peon

    Messages:
    146
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #5
    OK...I found the original site => phptutorial.info/iptocountry/the_script.html

    I can't post the live link so all apologies.

    Bobby
     
    Chemo, Jun 17, 2006 IP
  6. deny

    deny Active Member

    Messages:
    365
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #6
    You can simple via hotscripts.com/ find many free IP-to-Country converter script.
     
    deny, Jun 19, 2006 IP
  7. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #7
    Hi Chemo,


    Whats the base domain for that link? :)


    Cheers
     
    Weirfire, Jun 21, 2006 IP