I'd recommend against letting the user enter those codes, however. I already
had a MySQL table with the ISO country code/full name data (which was
referenced by a couple other tables) and so it was very simple to generate a
<SELECT> on the input form, which had the side benefit of reducing the
validation logic to "did the user pick one?".
In my app, the user is filling out a form (or some similar mechanism) on their site, and only comes to me to run a script, and get a terse result. As such, I have to sanity-check EVERY field, rather extensively.
There's a version on my site, that uses select boxes, so that the user picks the state and/or country, and the valid codes are then assured. (plus there's a security mechanism that assures that this input is coming from my form, not someone elses.)
--
www.SpamWhack.com A pre-emptive strike against spam
Where's dave?
http://www.findu.com/cgi-bin/find.cgi?kc6ete-9
My transistor sings
with unintended parasitic
the smoke escapes
By Jeff Stout