Can someone please go over the basics of how a site admin can arrange for their site to display different content based on the geographic origin of a visitor? I understand the idea that sometimes site admins want to show one thing to humans and another thing to spiders for SEO purposes, but what can Joe Administrator do to arrange for a Japanese site visitor to see one thing while a Korean visitor sees another? I posted this on another part of the forum, where the thread got no traction, and it was recommended that I post here in the PHP area...
There are several GeoIP database providers on the net. One of them (maxmind) has PHP library and IP databases free for downloading. Check it out.
Here is a script that I did which has the get country function. http://www.free-php-scripts.net/P/Geo_IP It uses maxminds library, thus you should update it monthly. Peace,
so using the tools you guys describe above, the visitors' IPs are detected, but what then tells the server to display certain content?
You would get their country from their IP address in your scripts and then based on this you would serve them different content.
For example in the free script mentioned above, which uses a function: $ucountry = get_country(); if($ucountry=="japan") { print 'Japan message'; } else { print 'Korea message'; } If you want to target many more countries, use "switch" instead of "if" statement. Hope that helps you... Bye