The example below is a working mini app utilizing Maxmind's GeoLite database and open source library (http://www.maxmind.com/app/geolitecountry) to retrieve the country information from a given IP address.
Find out the geographic location (country) calculated from any IP address. Type in an IP, then press Recheck. (and don't forget to prove that you are human)
This solution is also will be soon available as a Wordpress plugin and a CodeIgniter library, both released under GPL.