- You should get data which covers longitude/latitude. try searching google "csv longitude latitude"
- get another csv list with cities and regions. try searching google "csv city region" or similar
import these in a database and write queries for longitude/latitude... find the city ... query city/region table ... et voila
At the current state, opengeodb provide geo coordinates and several other data (city name, zip) mainly for the german speaking area
GeoLite City
contain country, region, area code, metro code, city, and postal code information.
Coverage Worldwide
Accuracy Over 99.5% on a country level and 79% on a city level for the US within a 25 mile radius.
RS 2007-06-27: A very rich source for geodata (cities and towns, down to very small places) is fallingrain http://www.fallingrain.com/world/
RS 2007-07-02: Yet another rich source of geodata (except for the US) is http://earth-info.nga.mil/gns/html/namefiles.htm - ordered by country, zipped text files, one line per item. For Belgium for instance, it has 28359 items.
jdc 2007-07-02: Geodata for the US can be found here: http://geonames.usgs.gov/domestic/download_data.htm