runnerjp Posted May 24, 2008 Share Posted May 24, 2008 how could i do something like this / is it possible ok so a user picks what country the live in so uk our usa from drop down menu (allready know how to do this) but then they enter there place name so london.. if no 1 has entred london then it gets inserted into uk.txt if uk.txt does not exsist then uk.txt is created so next time someone goes to type in london under uk then london will spear as a selection long bloated but first is it possibe and second how...or is there a better way to go about it Quote Link to comment https://forums.phpfreaks.com/topic/107083-list-of-cities-picking-them-out/ Share on other sites More sharing options...
phpknight Posted May 24, 2008 Share Posted May 24, 2008 I would say a better way to go about it would just be to get a free database/text file somewhere of all the cities you can find and do it that way. If you do not want to do that, I would just make the user write the name in. There is no good reason to go about it in such a way as you would like. What app are you using this for? And will it only be the UK or the whole world? Quote Link to comment https://forums.phpfreaks.com/topic/107083-list-of-cities-picking-them-out/#findComment-548959 Share on other sites More sharing options...
runnerjp Posted May 24, 2008 Author Share Posted May 24, 2008 think i will go for just normal textfle approach..and develop it if i need too Quote Link to comment https://forums.phpfreaks.com/topic/107083-list-of-cities-picking-them-out/#findComment-548962 Share on other sites More sharing options...
.josh Posted May 24, 2008 Share Posted May 24, 2008 Yes it is possible, and fairly easy to do. Is there a better way? Depends on what this is for. If you are wanting to go the route of "London" not existing until someone enters it in, you're going to have to deal with issues like people misspelling it (london, Lndn, londn, LongDong, etc..). Do you plan on being able to search for people by city? Sending packages to people in the mail, or billing them? If not, then that's not really that big a deal. But you did mention you wanted it to be added to your existing dropdown, so it is some kind of deal. Overall, I'd agree with phpknight's suggestion: go find a database/text file of cities/states/countries/etc... Quote Link to comment https://forums.phpfreaks.com/topic/107083-list-of-cities-picking-them-out/#findComment-548963 Share on other sites More sharing options...
BlueSkyIS Posted May 24, 2008 Share Posted May 24, 2008 general rule: don't provide an option if there isn't one. in other words: if there is a limited number of options, allow a selection of those options instead of allowing the user to enter ad hoc data. Quote Link to comment https://forums.phpfreaks.com/topic/107083-list-of-cities-picking-them-out/#findComment-548965 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.