1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

geo ip address and php

Discussion in 'PHP' started by mortpig, Jun 6, 2004.

  1. #1
    hi i want to be able to check via php whether a visitor is based in the USA or not, does anybody have any good resources i could look into ?
     
    mortpig, Jun 6, 2004 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Do you have a geotargetting database yet?
     
    digitalpoint, Jun 6, 2004 IP
  3. mortpig

    mortpig Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    do u need one ?

    i was hoping all it was built into php.

    So u need to cross-reference the ip adress against a database of where that ip exists ?

    this cant be done in realtime at all ?
     
    mortpig, Jun 6, 2004 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    It can be done in realtime, but it does require a large database.
     
    digitalpoint, Jun 6, 2004 IP
  5. mortpig

    mortpig Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    how does one get their hands on a database ?
     
    mortpig, Jun 6, 2004 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    They usually can be found for sale. Search Google for one, and I bet you get a ton of AdSense ads for them.
     
    digitalpoint, Jun 6, 2004 IP
  7. sarahk

    sarahk iTamer Staff

    Messages:
    28,500
    Likes Received:
    4,460
    Best Answers:
    123
    Trophy Points:
    665
    #7
    I use a free database from http://ip-to-country.webhosting.info/
    It is large but if you're only interested in the USA then you could delete all the non usa records and then just find out if the record exists or not.

    quick and easy.

    it does require regular updates but isn't onerous.

    Sarah
     
    sarahk, Jun 7, 2004 IP
  8. nlopes

    nlopes Guest

    Messages:
    103
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    nlopes, Jun 7, 2004 IP
  9. vinyl

    vinyl Well-Known Member

    Messages:
    302
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    165
    #9
    www.ip2nation.com
     
    vinyl, Jun 7, 2004 IP
  10. nlopes

    nlopes Guest

    Messages:
    103
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    the ip2nation DB isn't very good, IMHO....
     
    nlopes, Jun 8, 2004 IP
  11. vinyl

    vinyl Well-Known Member

    Messages:
    302
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    165
    #11
    you say that based on what? i am also from europe, and site where i am using it is targetting europian countres and i never saw any problems... but that doesnt mean that there might be some. id really like to hear more from you... do you use the latest db?
     
    vinyl, Jun 8, 2004 IP
  12. nlopes

    nlopes Guest

    Messages:
    103
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I've never used such DB :) I've just take a look into it!!

    As it doesn't use delimeters for IPs, it is more likely to generate false positives.

    But if you want I may set an url with both DBs to let people test and report here the differences :)
     
    nlopes, Jun 8, 2004 IP
  13. vinyl

    vinyl Well-Known Member

    Messages:
    302
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    165
    #13
    no, i dont want to bother you with practical tests...:)
     
    vinyl, Jun 8, 2004 IP
  14. zerostar07

    zerostar07 Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    great links guys, i was looking for that :)
     
    zerostar07, Feb 2, 2008 IP
  15. mvl

    mvl Peon

    Messages:
    147
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #15
    Maxmind has great free databases for this. They also have code examples in PHP and several other programming languages. I personally prefer their paid webservices because they are always up to date and more accurate (Look at the url in my sig for an example). For your purposes the free database should be good enough.
     
    mvl, Feb 3, 2008 IP