I need data for all countries and their states and then their cities. I want to build a web form where in dropdown i give user option to select a country then states for that country are loaded then by selecting state he can select the city. I can do that all if i got the data.
Best to have a read about ISO 3166-2 and buy the database.
and consider which languages these dropdowns will be displayed in for non-english counties.
Also “State” is not the correct heading – they are called subdivisions. Eg: Province, County, island, state, etc
Cities is elsewhere on the web, but I can't remember the link.