[thelist] Country by IP address

Andy Budd andy at message.uk.com
Tue Jun 15 06:44:26 CDT 2004


Hi folks,

Thanks for the feedback so far. I probably should have been a little 
more specific as I've received quite a few emails either suggesting 
commercial services or stats packages.

I'm basically looking for some hints on how to write a simple php 
script (as I'm not a very good php programmer) to examine the IP 
address of a site visitor and guesstimate the visitors country by using 
a mySQL db lookup. It's for my personal site so I'm not really 
interested in any paid services.

I have a page of web design book recommendations 
(http://www.andybudd.com/books/) that link to amazon. The default is 
amazon.co.uk but people can change their preference to amazon.com. What 
I'd like to be able to do is tell if people are coming from the UK, and 
making the default amazon.co.uk, if they are coming from Canada, making 
the default amazon.ca and if they are coming from anywhere else, 
defaulting to amazon.com.

Any suggestions would be welcome

Andy Budd



More information about the thelist mailing list