[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]
Re: Mapping IP address to country
> I Would like to track the users that visit my website.
> Interested in knowing which country they are form.
> The IP address is got using $REMOTE_ADDR in PHP.
> Now how do I map this to the country of origin.
this is quite a complex task actually....
Normally u wud log the ip addresses and then compare them to a database of
known regions/isps for the ip blocks. this block info can be obtained from
the whois db at apnic.... U cud also do a rev dns on the ips and store the
results in a database and then see if the the dns ends with a country code
etc... All this is quite a messy business. The simple thing is to just ask
the users (it will give u better info!)
/\ |\/| |3 /\ r