edoceo

The list is based on what the USPS considers states.

<?php
function state_list($sel='')
{
  echo "<option value='AL'".($sel=='AL'?' selected':'').">Alabama</option>";
  echo "<option value='AK'".($sel=='AK'?' selected':'').">Alaska</option>";
  echo "<option value='AS'".($sel=='AS'?' selected':'').">American Samoa</option>";
  echo "<option value='AZ'".($sel=='AZ'?' selected':'').">Arizona</option>";
  echo "<option value='AR'".($sel=='AR'?' selected':'').">Arkansas</option>";
  echo "<option value='CA'".($sel=='CA'?' selected':'').">California</option>";
  echo "<option value='CO'".($sel=='CO'?' selected':'').">Colorado</option>";
  echo "<option value='CT'".($sel=='CT'?' selected':'').">Connecticut</option>";
  echo "<option value='DE'".($sel=='DE'?' selected':'').">Delaware</option>";
  echo "<option value='DC'".($sel=='DC'?' selected':'').">District of Columbia</option>";
  echo "<option value='FM'".($sel=='FM'?' selected':'').">Federated States of Micronesia</option>";
  echo "<option value='FL'".($sel=='FL'?' selected':'').">Florida</option>";
  echo "<option value='GA'".($sel=='GA'?' selected':'').">Georgia</option>";
  echo "<option value='GU'".($sel=='GU'?' selected':'').">Guam</option>";
  echo "<option value='HI'".($sel=='HI'?' selected':'').">Hawaii</option>";
  echo "<option value='ID'".($sel=='ID'?' selected':'').">Idaho</option>";
  echo "<option value='IL'".($sel=='IL'?' selected':'').">Illinois</option>";
  echo "<option value='IN'".($sel=='IN'?' selected':'').">Indiana</option>";
  echo "<option value='IA'".($sel=='IA'?' selected':'').">Iowa</option>";
  echo "<option value='KS'".($sel=='KS'?' selected':'').">Kansas</option>";
  echo "<option value='KY'".($sel=='KY'?' selected':'').">Kentucky</option>";
  echo "<option value='LA'".($sel=='LA'?' selected':'').">Louisiana</option>";
  echo "<option value='ME'".($sel=='ME'?' selected':'').">Maine</option>";
  echo "<option value='MH'".($sel=='MH'?' selected':'').">Marshall Islands</option>";
  echo "<option value='MD'".($sel=='MD'?' selected':'').">Maryland</option>";
  echo "<option value='MA'".($sel=='MA'?' selected':'').">Massachusetts</option>";
  echo "<option value='MI'".($sel=='MI'?' selected':'').">Michigan</option>";
  echo "<option value='MN'".($sel=='MN'?' selected':'').">Minnesota</option>";
  echo "<option value='MS'".($sel=='MS'?' selected':'').">Mississippi</option>";
  echo "<option value='MO'".($sel=='MO'?' selected':'').">Missouri</option>";
  echo "<option value='MT'".($sel=='MT'?' selected':'').">Montana</option>";
  echo "<option value='NE'".($sel=='NE'?' selected':'').">Nebraska</option>";
  echo "<option value='NV'".($sel=='NV'?' selected':'').">Nevada</option>";
  echo "<option value='NH'".($sel=='NH'?' selected':'').">New Hampshire</option>";
  echo "<option value='NJ'".($sel=='NJ'?' selected':'').">New Jersey</option>";
  echo "<option value='NM'".($sel=='NM'?' selected':'').">New Mexico</option>";
  echo "<option value='NY'".($sel=='NY'?' selected':'').">New York</option>";
  echo "<option value='NC'".($sel=='NC'?' selected':'').">North Carolina</option>";
  echo "<option value='ND'".($sel=='ND'?' selected':'').">North Dakota</option>";
  echo "<option value='MP'".($sel=='MP'?' selected':'').">Northern Mariana Islands</option>";
  echo "<option value='OH'".($sel=='OH'?' selected':'').">Ohio</option>";
  echo "<option value='OK'".($sel=='OK'?' selected':'').">Oklahoma</option>";
  echo "<option value='OR'".($sel=='OR'?' selected':'').">Oregon</option>";
  echo "<option value='PW'".($sel=='PW'?' selected':'').">Palau</option>";
  echo "<option value='PA'".($sel=='PA'?' selected':'').">Pennsylvania</option>";
  echo "<option value='PR'".($sel=='PR'?' selected':'').">Puerto Rico</option>";
  echo "<option value='RI'".($sel=='RI'?' selected':'').">Rhode Island</option>";
  echo "<option value='SC'".($sel=='SC'?' selected':'').">South Carolina</option>";
  echo "<option value='SD'".($sel=='SD'?' selected':'').">South Dakota</option>";
  echo "<option value='TN'".($sel=='TN'?' selected':'').">Tennessee</option>";
  echo "<option value='TX'".($sel=='TX'?' selected':'').">Texas</option>";
  echo "<option value='UT'".($sel=='UT'?' selected':'').">Utah</option>";
  echo "<option value='VT'".($sel=='VT'?' selected':'').">Vermont</option>";
  echo "<option value='VI'".($sel=='VI'?' selected':'').">Virgin Islands</option>";
  echo "<option value='VA'".($sel=='VA'?' selected':'').">Virginia</option>";
  echo "<option value='WA'".($sel=='WA'?' selected':'').">Washington</option>";
  echo "<option value='WV'".($sel=='WV'?' selected':'').">West Virginia</option>";
  echo "<option value='WI'".($sel=='WI'?' selected':'').">Wisconsin</option>";
  echo "<option value='WY'".($sel=='WY'?' selected':'').">Wyoming</option>";
}
?>

Loading Comments from Disqus...