Tagged

Who likes this?

PHP Dynamic Dropdown Box: State & Province - Remember Value On Submit

This snippet will allow you to dynamically create a form dropdown list of all of the states within the US, Canada and UK. It pulls them from a table called state in a database. This snippet is used in conjunction with http://snipplr.com/view/36725/stateprovince-for-united-states-canada-and-uk/ which will actually create the state table within your database. The dropdown list is sorted by the state_id so all US states are listed together, all CA provinces are listed together and the same for the UK.