Normally I would do something like this:
<select name="myselect">
<option value="opt1" <?=($_POST['myselect']=="opt1"?"SELECTED":"")?>>Option 1</option>
<option value="opt2" <?=($_POST['myselect']=="opt2"?"SELECTED":"")?>>Option 2</option>
</select>
However this time I've taken a list of all the countries in a select from this website: http://snippets.dzone.com/posts/show/376
To go through each of those and put in the validation will be insane.
There is a php solution in the comments but it seems somewhat inelegant.
Is there an alternative way to do this or something similar? I would prefer not to use javascript, and I'm not sure I want to rely on the browser caching.
Thanks