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 ?
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 ?
They usually can be found for sale. Search Google for one, and I bet you get a ton of AdSense ads for them.
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
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?
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
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.