bogeyman Posted November 17, 2008 Share Posted November 17, 2008 Dear all, How do I detect user's location (country) based on the IP address? Link to comment https://forums.phpfreaks.com/topic/133039-ip-to-country/ Share on other sites More sharing options...
ratcateme Posted November 17, 2008 Share Posted November 17, 2008 try reading this code it is the source of php.net country detection. http://ch2.php.net/source.php?url=/include/ip-to-country.inc it has two includes that both can be access at: http://php.net/backend/ip-to-country.db http://php.net/backend/ip-to-country.idx it should tell you the country if you go i2c_go(); echo $COUNTRY; beware it also sets a cookie to record the country for one week so it doesn't have to search the database all the time. Scott. Link to comment https://forums.phpfreaks.com/topic/133039-ip-to-country/#findComment-691909 Share on other sites More sharing options...
bogeyman Posted November 18, 2008 Author Share Posted November 18, 2008 It works. Thanx Link to comment https://forums.phpfreaks.com/topic/133039-ip-to-country/#findComment-692463 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.