RSS Feed
Sep 26

PHP & HTML Code for Displaying Country Codes

Posted on Monday, September 26, 2011 in Information, Programming, Web Design

Tonight I was in the middle of coding a project I’ve been working on for the past couple of months and I realized what a pain in the ass it can become to deal with country drop-down select inputs. One of the main issues I came up with was how I should display the country code drop-down box in the Edit Page. In order for it to properly display, you have to tell the form to select the correct country from the drop down depending on what your MySQL database has stored. So for example, if your MySQL Database field stored “US” as the country code you’d obviously want it to display “United States” in your HTML select input. However, What happens when you get country codes like “AG, BN, EE, …etc.” Most people don’t even know what most of the country code abbreviations are so I wanted to put together a post to help others who come into similar issues.

Here’s a list of all the country codes I’m using:

Two Letter Country Abbreviations

AC   Ascension Island
AD   Andorra
AE   United Arab Emirates
AF   Afghanistan
AG   Antigua and Barbuda
AI   Anguilla
AL   Albania
AM   Armenia
AN   Netherland Antilles
AO   Angola
AQ   Antarctica
AR   Argentina
AS   American Samoa
AT   Austria
AU   Australia
AW   Aruba
AZ   Azerbaidjan
BA   Bosnia-Herzegovina
BB   Barbados
BD   Bangladesh
BE   Belgium
BF   Burkina Faso
BG   Bulgaria
BH   Bahrain
BI   Burundi
BJ   Benin
BM   Bermuda
BN   Brunei Darussalam
BO   Bolivia
BR   Brazil
BS   Bahamas
BT   Buthan
BV   Bouvet Island
BW   Botswana
BY   Belarus
BZ   Belize
CA   Canada
CC   Cocos (Keeling) Isl.
CD   Congo, The Democratic Republic of the
CF   Central African Rep.
CG   Congo, Republic of
CH   Switzerland
CI   Ivory Coast
CK   Cook Islands
CL   Chile
CM   Cameroon
CN   China
CO   Colombia
CR   Costa Rica
CS   Serbia and Montenegro
CU   Cuba
CV   Cape Verde
CX   Christmas Island
CY   Cyprus
CZ   Czech Republic
DE   Germany
DJ   Djibouti
DK   Denmark
DM   Dominica
DO   Dominican Republic
DZ   Algeria
EC   Ecuador
EE   Estonia
EG   Egypt
EH   Western Sahara
ER   Eritrea
ES   Spain
ET   Ethiopia
FI   Finland
FJ   Fiji
FK   Falkland Isl.(Malvinas)
FM   Micronesia
FO   Faroe Islands
FR   France
GA   Gabon
GB   Great Britain (UK)
GD   Grenada
GE   Georgia
GF   Guyana (Fr.)
GG   Guernsey
GH   Ghana
GI   Gibraltar
GL   Greenland
GM   Gambia
GN   Guinea
GP   Guadeloupe (Fr.)
GQ   Equatorial Guinea
GR   Greece
GS   South Georgia and the South Sandwich Islands
GT   Guatemala
GU   Guam (US)
GW   Guinea Bissau
GY   Guyana
HK   Hong Kong
HM   Heard & McDonald Isl.
HN   Honduras
HR   Croatia
HT   Haiti
HU   Hungary
ID   Indonesia
IE   Ireland
IL   Israel
IM   Isle of Man
IN   India
IO   British Indian O. Terr.
IQ   Iraq
IR   Iran
IS   Iceland
IT   Italy
JM   Jamaica
JO   Jordan
JP   Japan
KE   Kenya
KG   Kirgistan
KH   Cambodia
KI   Kiribati
KM   Comoros
KN   St.Kitts Nevis Anguilla
KP   Korea (North)
KR   Korea (South)
KW   Kuwait
KY   Cayman Islands
KZ   Kazachstan
LA   Laos
LB   Lebanon
LC   Saint Lucia
LI   Liechtenstein
LK   Sri Lanka
LR   Liberia
LS   Lesotho
LT   Lithuania
LU   Luxembourg
LV   Latvia
LY   Libya
MA   Morocco
MC   Monaco
MD   Moldavia
MG   Madagascar
MH   Marshall Islands
MK   Macedonia, The Former Yugoslav Republic of
ML   Mali
MM   Myanmar
MN   Mongolia
MO   Macau
MP   Northern Mariana Isl.
MQ   Martinique (Fr.)
MR   Mauritania
MS   Montserrat
MT   Malta
MU   Mauritius
MV   Maldives
MW   Malawi
MX   Mexico
MY   Malaysia
MZ   Mozambique
NA   Namibia
NC   New Caledonia (Fr.)
NE   Niger
NF   Norfolk Island
NG   Nigeria
NI   Nicaragua
NL   Netherlands
NO   Norway
NP   Nepal
NR   Nauru
NU   Niue
NZ   New Zealand
OM   Oman
PA   Panama
PE   Peru
PF   Polynesia (Fr.)
PG   Papua New Guinea
PH   Philippines
PK   Pakistan
PL   Poland
PM   St. Pierre & Miquelon
PN   Pitcairn
PR   Puerto Rico (US)
PT   Portugal
PW   Palau
PY   Paraguay
QA   Qatar
RE   Reunion (Fr.)
RO   Romania
RU   Russian Federation
RW   Rwanda
SA   Saudi Arabia
SB   Solomon Islands
SC   Seychelles
SD   Sudan
SE   Sweden
SG   Singapore
SH   St. Helena
SI   Slovenia
SJ   Svalbard & Jan Mayen Islands
SK   Slovak Republic
SL   Sierra Leone
SM   San Marino
SN   Senegal
SO   Somalia
SR   Suriname
ST   St. Tome and Principe
SV   El Salvador
SY   Syria
SZ   Swaziland
TC   Turks & Caicos Islands
TD   Chad
TF   French Southern Terr.
TG   Togo
TH   Thailand
TJ   Tadjikistan
TK   Tokelau
TM   Turkmenistan
TN   Tunisia
TO   Tonga
TP   East Timor
TR   Turkey
TT   Trinidad & Tobago
TV   Tuvalu
TW   Taiwan
TZ   Tanzania
UA   Ukraine
UG   Uganda
UK   United Kingdom
UM   US Minor outlying Isl.
US   United States
UY   Uruguay
UZ   Uzbekistan
VA   Vatican City State
VC   St.Vincent & Grenadines
VE   Venezuela
VG   Virgin Islands (British)
VI   Virgin Islands (US)
VN   Vietnam
VU   Vanuatu
WF   Wallis & Futuna Islands
WS   Samoa
YE   Yemen
YU   Yugoslavia
ZA   South Africa
ZM   Zambia
ZR   Zaire
ZW   Zimbabwe
 
AF   Afghanistan
AL   Albania
DZ   Algeria
AS   American Samoa
AD   Andorra
AO   Angola
AI   Anguilla
AQ   Antarctica
AG   Antigua and Barbuda
AR   Argentina
AM   Armenia
AW   Aruba
AC   Ascension Island
AU   Australia
AT   Austria
AZ   Azerbaidjan
BS   Bahamas
BH   Bahrain
BD   Bangladesh
BB   Barbados
BY   Belarus
BE   Belgium
BZ   Belize
BJ   Benin
BM   Bermuda
BO   Bolivia
BA   Bosnia-Herzegovina
BW   Botswana
BV   Bouvet Island
BR   Brazil
IO   British Indian O. Terr.
BN   Brunei Darussalam
BG   Bulgaria
BF   Burkina Faso
BI   Burundi
BT   Buthan
KH   Cambodia
CM   Cameroon
CA   Canada
CV   Cape Verde
KY   Cayman Islands
CF   Central African Rep.
TD   Chad
CL   Chile
CN   China
CX   Christmas Island
CC   Cocos (Keeling) Isl.
CO   Colombia
KM   Comoros
CG   Congo, Republic of
CD   Congo, The Democratic Republic of the
CK   Cook Islands
CR   Costa Rica
HR   Croatia
CU   Cuba
CY   Cyprus
CZ   Czech Republic
DK   Denmark
DJ   Djibouti
DM   Dominica
DO   Dominican Republic
TP   East Timor
EC   Ecuador
EG   Egypt
SV   El Salvador
GQ   Equatorial Guinea
ER   Eritrea
EE   Estonia
ET   Ethiopia
FK   Falkland Isl.(Malvinas)
FO   Faroe Islands
FJ   Fiji
FI   Finland
FR   France
TF   French Southern Terr.
GA   Gabon
GM   Gambia
GE   Georgia
DE   Germany
GH   Ghana
GI   Gibraltar
GB   Great Britain (UK)
GR   Greece
GL   Greenland
GD   Grenada
GP   Guadeloupe (Fr.)
GU   Guam (US)
GT   Guatemala
GG   Guernsey
GN   Guinea
GW   Guinea Bissau
GY   Guyana
GF   Guyana (Fr.)
HT   Haiti
HM   Heard & McDonald Isl.
HN   Honduras
HK   Hong Kong
HU   Hungary
IS   Iceland
IN   India
ID   Indonesia
IR   Iran
IQ   Iraq
IE   Ireland
IM   Isle of Man
IL   Israel
IT   Italy
CI   Ivory Coast
JM   Jamaica
JP   Japan
JO   Jordan
KZ   Kazachstan
KE   Kenya
KG   Kirgistan
KI   Kiribati
KP   Korea (North)
KR   Korea (South)
KW   Kuwait
LA   Laos
LV   Latvia
LB   Lebanon
LS   Lesotho
LR   Liberia
LY   Libya
LI   Liechtenstein
LT   Lithuania
LU   Luxembourg
MO   Macau
MK   Macedonia, The Former Yugoslav Republic of
MG   Madagascar
MW   Malawi
MY   Malaysia
MV   Maldives
ML   Mali
MT   Malta
MH   Marshall Islands
MQ   Martinique (Fr.)
MR   Mauritania
MU   Mauritius
MX   Mexico
FM   Micronesia
MD   Moldavia
MC   Monaco
MN   Mongolia
MS   Montserrat
MA   Morocco
MZ   Mozambique
MM   Myanmar
NA   Namibia
NR   Nauru
NP   Nepal
AN   Netherland Antilles
NL   Netherlands
NC   New Caledonia (Fr.)
NZ   New Zealand
NI   Nicaragua
NE   Niger
NG   Nigeria
NU   Niue
NF   Norfolk Island
MP   Northern Mariana Isl.
NO   Norway
OM   Oman
PK   Pakistan
PW   Palau
PA   Panama
PG   Papua New Guinea
PY   Paraguay
PE   Peru
PH   Philippines
PN   Pitcairn
PL   Poland
PF   Polynesia (Fr.)
PT   Portugal
PR   Puerto Rico (US)
QA   Qatar
RE   Reunion (Fr.)
RO   Romania
RU   Russian Federation
RW   Rwanda
LC   Saint Lucia
WS   Samoa
SM   San Marino
SA   Saudi Arabia
SN   Senegal
CS   Serbia and Montenegro
SC   Seychelles
SL   Sierra Leone
SG   Singapore
SK   Slovak Republic
SI   Slovenia
SB   Solomon Islands
SO   Somalia
ZA   South Africa
GS   South Georgia and the South Sandwich Islands
ES   Spain
LK   Sri Lanka
SH   St. Helena
PM   St. Pierre & Miquelon
ST   St. Tome and Principe
KN   St.Kitts Nevis Anguilla
VC   St.Vincent & Grenadines
SD   Sudan
SR   Suriname
SJ   Svalbard & Jan Mayen Islands
SZ   Swaziland
SE   Sweden
CH   Switzerland
SY   Syria
TJ   Tadjikistan
TW   Taiwan
TZ   Tanzania
TH   Thailand
TG   Togo
TK   Tokelau
TO   Tonga
TT   Trinidad & Tobago
TN   Tunisia
TR   Turkey
TM   Turkmenistan
TC   Turks & Caicos Islands
TV   Tuvalu
UM   US Minor outlying Isl.
UG   Uganda
UA   Ukraine
AE   United Arab Emirates
UK   United Kingdom
US   United States
UY   Uruguay
UZ   Uzbekistan
VU   Vanuatu
VA   Vatican City State
VE   Venezuela
VN   Vietnam
VG   Virgin Islands (British)
VI   Virgin Islands (US)
WF   Wallis & Futuna Islands
EH   Western Sahara
YE   Yemen
YU   Yugoslavia
ZR   Zaire
ZM   Zambia
ZW   Zimbabwe

HTML Country Select Input with United States Selected:

<select name="country">
<option value="AF">Afghanistan</option>
<option value="AX">ÅLand Islands</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>
<option value="AG">Antigua And Barbuda</option>
<option value="AR">Argentina</option>
<option value="AM">Armenia</option>
<option value="AW">Aruba</option>
<option value="AU">Australia</option>
<option value="AT">Austria</option>
<option value="AZ">Azerbaijan</option>
<option value="BS">Bahamas</option>
<option value="BH">Bahrain</option>
<option value="BD">Bangladesh</option>
<option value="BB">Barbados</option>
<option value="BY">Belarus</option>
<option value="BE">Belgium</option>
<option value="BZ">Belize</option>
<option value="BJ">Benin</option>
<option value="BM">Bermuda</option>
<option value="BT">Bhutan</option>
<option value="BO">Bolivia</option>
<option value="BA">Bosnia And Herzegovina</option>
<option value="BW">Botswana</option>
<option value="BV">Bouvet Island</option>
<option value="BR">Brazil</option>
<option value="IO">British Indian Ocean Territory</option>
<option value="BN">Brunei Darussalam</option>
<option value="BG">Bulgaria</option>
<option value="BF">Burkina Faso</option>
<option value="BI">Burundi</option>
<option value="KH">Cambodia</option>
<option value="CM">Cameroon</option>
<option value="CA">Canada</option>
<option value="CV">Cape Verde</option>
<option value="KY">Cayman Islands</option>
<option value="CF">Central African Republic</option>
<option value="TD">Chad</option>
<option value="CL">Chile</option>
<option value="CN">China</option>
<option value="CX">Christmas Island</option>
<option value="CC">Cocos (Keeling) Islands</option>
<option value="CO">Colombia</option>
<option value="KM">Comoros</option>
<option value="CG">Congo</option>
<option value="CD">Congo, The Democratic Republic Of The</option>
<option value="CK">Cook Islands</option>
<option value="CR">Costa Rica</option>
<option value="CI">Cote D'Ivoire</option>
<option value="HR">Croatia</option>
<option value="CU">Cuba</option>
<option value="CY">Cyprus</option>
<option value="CZ">Czech Republic</option>
<option value="DK">Denmark</option>
<option value="DJ">Djibouti</option>
<option value="DM">Dominica</option>
<option value="DO">Dominican Republic</option>
<option value="EC">Ecuador</option>
<option value="EG">Egypt</option>
<option value="SV">El Salvador</option>
<option value="GQ">Equatorial Guinea</option>
<option value="ER">Eritrea</option>
<option value="EE">Estonia</option>
<option value="ET">Ethiopia</option>
<option value="FK">Falkland Islands (Malvinas)</option>
<option value="FO">Faroe Islands</option>
<option value="FJ">Fiji</option>
<option value="FI">Finland</option>
<option value="FR">France</option>
<option value="GF">French Guiana</option>
<option value="PF">French Polynesia</option>
<option value="TF">French Southern Territories</option>
<option value="GA">Gabon</option>
<option value="GM">Gambia</option>
<option value="GE">Georgia</option>
<option value="DE">Germany</option>
<option value="GH">Ghana</option>
<option value="GI">Gibraltar</option>
<option value="GR">Greece</option>
<option value="GL">Greenland</option>
<option value="GD">Grenada</option>
<option value="GP">Guadeloupe</option>
<option value="GU">Guam</option>
<option value="GT">Guatemala</option>
<option value="GG">Guernsey</option>
<option value="GN">Guinea</option>
<option value="GW">Guinea-Bissau</option>
<option value="GY">Guyana</option>
<option value="HT">Haiti</option>
<option value="HM">Heard Island And Mcdonald Islands</option>
<option value="VA">Holy See (Vatican City State)</option>
<option value="HN">Honduras</option>
<option value="HK">Hong Kong</option>
<option value="HU">Hungary</option>
<option value="IS">Iceland</option>
<option value="IN">India</option>
<option value="ID">Indonesia</option>
<option value="IR">Iran, Islamic Republic Of</option>
<option value="IQ">Iraq</option>
<option value="IE">Ireland</option>
<option value="IM">Isle Of Man</option>
<option value="IL">Israel</option>
<option value="IT">Italy</option>
<option value="JM">Jamaica</option>
<option value="JP">Japan</option>
<option value="JE">Jersey</option>
<option value="JO">Jordan</option>
<option value="KZ">Kazakhstan</option>
<option value="KE">Kenya</option>
<option value="KI">Kiribati</option>
<option value="KP">Korea, Democratic People'S Republic Of</option>
<option value="KR">Korea, Republic Of</option>
<option value="KW">Kuwait</option>
<option value="KG">Kyrgyzstan</option>
<option value="LA">Lao People'S Democratic Republic</option>
<option value="LV">Latvia</option>
<option value="LB">Lebanon</option>
<option value="LS">Lesotho</option>
<option value="LR">Liberia</option>
<option value="LY">Libyan Arab Jamahiriya</option>
<option value="LI">Liechtenstein</option>
<option value="LT">Lithuania</option>
<option value="LU">Luxembourg</option>
<option value="MO">Macao</option>
<option value="MK">Macedonia, The Former Yugoslav Republic Of</option>
<option value="MG">Madagascar</option>
<option value="MW">Malawi</option>
<option value="MY">Malaysia</option>
<option value="MV">Maldives</option>
<option value="ML">Mali</option>
<option value="MT">Malta</option>
<option value="MH">Marshall Islands</option>
<option value="MQ">Martinique</option>
<option value="MR">Mauritania</option>
<option value="MU">Mauritius</option>
<option value="YT">Mayotte</option>
<option value="MX">Mexico</option>
<option value="FM">Micronesia, Federated States Of</option>
<option value="MD">Moldova, Republic Of</option>
<option value="MC">Monaco</option>
<option value="MN">Mongolia</option>
<option value="MS">Montserrat</option>
<option value="MA">Morocco</option>
<option value="MZ">Mozambique</option>
<option value="MM">Myanmar</option>
<option value="NA">Namibia</option>
<option value="NR">Nauru</option>
<option value="NP">Nepal</option>
<option value="NL">Netherlands</option>
<option value="AN">Netherlands Antilles</option>
<option value="NC">New Caledonia</option>
<option value="NZ">New Zealand</option>
<option value="NI">Nicaragua</option>
<option value="NE">Niger</option>
<option value="NG">Nigeria</option>
<option value="NU">Niue</option>
<option value="NF">Norfolk Island</option>
<option value="MP">Northern Mariana Islands</option>
<option value="NO">Norway</option>
<option value="OM">Oman</option>
<option value="PK">Pakistan</option>
<option value="PW">Palau</option>
<option value="PS">Palestinian Territory, Occupied</option>
<option value="PA">Panama</option>
<option value="PG">Papua New Guinea</option>
<option value="PY">Paraguay</option>
<option value="PE">Peru</option>
<option value="PH">Philippines</option>
<option value="PN">Pitcairn</option>
<option value="PL">Poland</option>
<option value="PT">Portugal</option>
<option value="PR">Puerto Rico</option>
<option value="QA">Qatar</option>
<option value="RE">Reunion</option>
<option value="RO">Romania</option>
<option value="RU">Russian Federation</option>
<option value="RW">Rwanda</option>
<option value="SH">Saint Helena</option>
<option value="KN">Saint Kitts And Nevis</option>
<option value="LC">Saint Lucia</option>
<option value="PM">Saint Pierre And Miquelon</option>
<option value="VC">Saint Vincent And The Grenadines</option>
<option value="WS">Samoa</option>
<option value="SM">San Marino</option>
<option value="ST">Sao Tome And Principe</option>
<option value="SA">Saudi Arabia</option>
<option value="SN">Senegal</option>
<option value="CS">Serbia And Montenegro</option>
<option value="SC">Seychelles</option>
<option value="SL">Sierra Leone</option>
<option value="SG">Singapore</option>
<option value="SK">Slovakia</option>
<option value="SI">Slovenia</option>
<option value="SB">Solomon Islands</option>
<option value="SO">Somalia</option>
<option value="ZA">South Africa</option>
<option value="GS">South Georgia And The South Sandwich Islands</option>
<option value="ES">Spain</option>
<option value="LK">Sri Lanka</option>
<option value="SD">Sudan</option>
<option value="SR">Suriname</option>
<option value="SJ">Svalbard And Jan Mayen</option>
<option value="SZ">Swaziland</option>
<option value="SE">Sweden</option>
<option value="CH">Switzerland</option>
<option value="SY">Syrian Arab Republic</option>
<option value="TW">Taiwan, Province Of China</option>
<option value="TJ">Tajikistan</option>
<option value="TZ">Tanzania, United Republic Of</option>
<option value="TH">Thailand</option>
<option value="TL">Timor-Leste</option>
<option value="TG">Togo</option>
<option value="TK">Tokelau</option>
<option value="TO">Tonga</option>
<option value="TT">Trinidad And Tobago</option>
<option value="TN">Tunisia</option>
<option value="TR">Turkey</option>
<option value="TM">Turkmenistan</option>
<option value="TC">Turks And Caicos Islands</option>
<option value="TV">Tuvalu</option>
<option value="UG">Uganda</option>
<option value="UA">Ukraine</option>
<option value="AE">United Arab Emirates</option>
<option value="GB">United Kingdom</option>
<option selected="selected" value="US">United States</option>
<option value="UM">United States Minor Outlying Islands</option>
<option value="UY">Uruguay</option>
<option value="UZ">Uzbekistan</option>
<option value="VU">Vanuatu</option>
<option value="VE">Venezuela</option>
<option value="VN">Viet Nam</option>
<option value="VG">Virgin Islands, British</option>
<option value="VI">Virgin Islands, U.S.</option>
<option value="WF">Wallis And Futuna</option>
<option value="EH">Western Sahara</option>
<option value="YE">Yemen</option>
<option value="ZM">Zambia</option>
<option value="ZW">Zimbabwe</option>
  </select>

Lastly, the most time consuming part for me was writing the PHP IF statements for each country so that if a user has a specific country chosen and saved in the database country field, it selects that country so it defaults in the drop-down. There are many ways to do this, but regardless of which way you use, it needs to be done otherwise each time your site user goes to edit their profile, they’ll have to select their country from the drop down. This can get tedious and annoying for your members. Even though you can copy and paste all the IF statements, you’d still have to manually type in each country abbreviation to check them against the databases $country variable. So here’s the code I decided to use…

PHP Edit Page Country Code Select Input:

<select name="country">
<option value="AF" <?php if($country == 'AF') { echo 'selected="selected"'; } ?>>Afghanistan</option>
<option value="AX" <?php if($country == 'AX') { echo 'selected="selected"'; } ?>>ÅLand Islands</option>
<option value="AL" <?php if($country == 'AL') { echo 'selected="selected"'; } ?>>Albania</option>
<option value="DZ" <?php if($country == 'DZ') { echo 'selected="selected"'; } ?>>Algeria</option>
<option value="AS" <?php if($country == 'AS') { echo 'selected="selected"'; } ?>>American Samoa</option>
<option value="AD" <?php if($country == 'AD') { echo 'selected="selected"'; } ?>>Andorra</option>
<option value="AO" <?php if($country == 'AO') { echo 'selected="selected"'; } ?>>Angola</option>
<option value="AI" <?php if($country == 'AI') { echo 'selected="selected"'; } ?>>Anguilla</option>
<option value="AQ" <?php if($country == 'AQ') { echo 'selected="selected"'; } ?>>Antarctica</option>
<option value="AG" <?php if($country == 'AG') { echo 'selected="selected"'; } ?>>Antigua And Barbuda</option>
<option value="AR" <?php if($country == 'AR') { echo 'selected="selected"'; } ?>>Argentina</option>
<option value="AM" <?php if($country == 'AN') { echo 'selected="selected"'; } ?>>Armenia</option>
<option value="AW" <?php if($country == 'AW') { echo 'selected="selected"'; } ?>>Aruba</option>
<option value="AU" <?php if($country == 'AU') { echo 'selected="selected"'; } ?>>Australia</option>
<option value="AT" <?php if($country == 'AT') { echo 'selected="selected"'; } ?>>Austria</option>
<option value="AZ" <?php if($country == 'AZ') { echo 'selected="selected"'; } ?>>Azerbaijan</option>
<option value="BS" <?php if($country == 'BS') { echo 'selected="selected"'; } ?>>Bahamas</option>
<option value="BH" <?php if($country == 'BH') { echo 'selected="selected"'; } ?>>Bahrain</option>
<option value="BD" <?php if($country == 'BD') { echo 'selected="selected"'; } ?>>Bangladesh</option>
<option value="BB" <?php if($country == 'BB') { echo 'selected="selected"'; } ?>>Barbados</option>
<option value="BY" <?php if($country == 'BY') { echo 'selected="selected"'; } ?>>Belarus</option>
<option value="BE" <?php if($country == 'BE') { echo 'selected="selected"'; } ?>>Belgium</option>
<option value="BZ" <?php if($country == 'BZ') { echo 'selected="selected"'; } ?>>Belize</option>
<option value="BJ" <?php if($country == 'BJ') { echo 'selected="selected"'; } ?>>Benin</option>
<option value="BM" <?php if($country == 'BM') { echo 'selected="selected"'; } ?>>Bermuda</option>
<option value="BT" <?php if($country == 'BT') { echo 'selected="selected"'; } ?>>Bhutan</option>
<option value="BO" <?php if($country == 'BO') { echo 'selected="selected"'; } ?>>Bolivia</option>
<option value="BA" <?php if($country == 'BA') { echo 'selected="selected"'; } ?>>Bosnia And Herzegovina</option>
<option value="BW" <?php if($country == 'BW') { echo 'selected="selected"'; } ?>>Botswana</option>
<option value="BV" <?php if($country == 'BV') { echo 'selected="selected"'; } ?>>Bouvet Island</option>
<option value="BR" <?php if($country == 'BR') { echo 'selected="selected"'; } ?>>Brazil</option>
<option value="IO" <?php if($country == 'IO') { echo 'selected="selected"'; } ?>>British Indian Ocean Territory</option>
<option value="BN" <?php if($country == 'BN') { echo 'selected="selected"'; } ?>>Brunei Darussalam</option>
<option value="BG" <?php if($country == 'BG') { echo 'selected="selected"'; } ?>>Bulgaria</option>
<option value="BF" <?php if($country == 'BF') { echo 'selected="selected"'; } ?>>Burkina Faso</option>
<option value="BI" <?php if($country == 'BI') { echo 'selected="selected"'; } ?>>Burundi</option>
<option value="KH" <?php if($country == 'KH') { echo 'selected="selected"'; } ?>>Cambodia</option>
<option value="CM" <?php if($country == 'CM') { echo 'selected="selected"'; } ?>>Cameroon</option>
<option value="CA" <?php if($country == 'CA') { echo 'selected="selected"'; } ?>>Canada</option>
<option value="CV" <?php if($country == 'CV') { echo 'selected="selected"'; } ?>>Cape Verde</option>
<option value="KY" <?php if($country == 'KY') { echo 'selected="selected"'; } ?>>Cayman Islands</option>
<option value="CF" <?php if($country == 'CF') { echo 'selected="selected"'; } ?>>Central African Republic</option>
<option value="TD" <?php if($country == 'TD') { echo 'selected="selected"'; } ?>>Chad</option>
<option value="CL" <?php if($country == 'CL') { echo 'selected="selected"'; } ?>>Chile</option>
<option value="CN" <?php if($country == 'CN') { echo 'selected="selected"'; } ?>>China</option>
<option value="CX" <?php if($country == 'CX') { echo 'selected="selected"'; } ?>>Christmas Island</option>
<option value="CC" <?php if($country == 'CC') { echo 'selected="selected"'; } ?>>Cocos (Keeling) Islands</option>
<option value="CO" <?php if($country == 'CO') { echo 'selected="selected"'; } ?>>Colombia</option>
<option value="KM" <?php if($country == 'KM') { echo 'selected="selected"'; } ?>>Comoros</option>
<option value="CG" <?php if($country == 'CG') { echo 'selected="selected"'; } ?>>Congo</option>
<option value="CD" <?php if($country == 'CD') { echo 'selected="selected"'; } ?>>Congo, The Democratic Republic Of The</option>
<option value="CK" <?php if($country == 'CK') { echo 'selected="selected"'; } ?>>Cook Islands</option>
<option value="CR" <?php if($country == 'CR') { echo 'selected="selected"'; } ?>>Costa Rica</option>
<option value="CI" <?php if($country == 'CI') { echo 'selected="selected"'; } ?>>Cote D'Ivoire</option>
<option value="HR" <?php if($country == 'HR') { echo 'selected="selected"'; } ?>>Croatia</option>
<option value="CU" <?php if($country == 'CU') { echo 'selected="selected"'; } ?>>Cuba</option>
<option value="CY" <?php if($country == 'CY') { echo 'selected="selected"'; } ?>>Cyprus</option>
<option value="CZ" <?php if($country == 'CZ') { echo 'selected="selected"'; } ?>>Czech Republic</option>
<option value="DK" <?php if($country == 'DK') { echo 'selected="selected"'; } ?>>Denmark</option>
<option value="DJ" <?php if($country == 'DJ') { echo 'selected="selected"'; } ?>>Djibouti</option>
<option value="DM" <?php if($country == 'DM') { echo 'selected="selected"'; } ?>>Dominica</option>
<option value="DO" <?php if($country == 'DO') { echo 'selected="selected"'; } ?>>Dominican Republic</option>
<option value="EC" <?php if($country == 'EC') { echo 'selected="selected"'; } ?>>Ecuador</option>
<option value="EG" <?php if($country == 'EG') { echo 'selected="selected"'; } ?>>Egypt</option>
<option value="SV" <?php if($country == 'SV') { echo 'selected="selected"'; } ?>>El Salvador</option>
<option value="GQ" <?php if($country == 'GQ') { echo 'selected="selected"'; } ?>>Equatorial Guinea</option>
<option value="ER" <?php if($country == 'ER') { echo 'selected="selected"'; } ?>>Eritrea</option>
<option value="EE" <?php if($country == 'EE') { echo 'selected="selected"'; } ?>>Estonia</option>
<option value="ET" <?php if($country == 'ET') { echo 'selected="selected"'; } ?>>Ethiopia</option>
<option value="FK" <?php if($country == 'FK') { echo 'selected="selected"'; } ?>>Falkland Islands (Malvinas)</option>
<option value="FO" <?php if($country == 'FO') { echo 'selected="selected"'; } ?>>Faroe Islands</option>
<option value="FJ" <?php if($country == 'FJ') { echo 'selected="selected"'; } ?>>Fiji</option>
<option value="FI" <?php if($country == 'FI') { echo 'selected="selected"'; } ?>>Finland</option>
<option value="FR" <?php if($country == 'FR') { echo 'selected="selected"'; } ?>>France</option>
<option value="GF" <?php if($country == 'GF') { echo 'selected="selected"'; } ?>>French Guiana</option>
<option value="PF" <?php if($country == 'PF') { echo 'selected="selected"'; } ?>>French Polynesia</option>
<option value="TF" <?php if($country == 'TF') { echo 'selected="selected"'; } ?>>French Southern Territories</option>
<option value="GA" <?php if($country == 'GA') { echo 'selected="selected"'; } ?>>Gabon</option>
<option value="GM" <?php if($country == 'GM') { echo 'selected="selected"'; } ?>>Gambia</option>
<option value="GE" <?php if($country == 'GE') { echo 'selected="selected"'; } ?>>Georgia</option>
<option value="DE" <?php if($country == 'DE') { echo 'selected="selected"'; } ?>>Germany</option>
<option value="GH" <?php if($country == 'GH') { echo 'selected="selected"'; } ?>>Ghana</option>
<option value="GI" <?php if($country == 'GI') { echo 'selected="selected"'; } ?>>Gibraltar</option>
<option value="GR" <?php if($country == 'GR') { echo 'selected="selected"'; } ?>>Greece</option>
<option value="GL" <?php if($country == 'GL') { echo 'selected="selected"'; } ?>>Greenland</option>
<option value="GD" <?php if($country == 'GD') { echo 'selected="selected"'; } ?>>Grenada</option>
<option value="GP" <?php if($country == 'GP') { echo 'selected="selected"'; } ?>>Guadeloupe</option>
<option value="GU" <?php if($country == 'GU') { echo 'selected="selected"'; } ?>>Guam</option>
<option value="GT" <?php if($country == 'GT') { echo 'selected="selected"'; } ?>>Guatemala</option>
<option value="GG" <?php if($country == 'GG') { echo 'selected="selected"'; } ?>>Guernsey</option>
<option value="GN" <?php if($country == 'GN') { echo 'selected="selected"'; } ?>>Guinea</option>
<option value="GW" <?php if($country == 'GW') { echo 'selected="selected"'; } ?>>Guinea-Bissau</option>
<option value="GY" <?php if($country == 'GY') { echo 'selected="selected"'; } ?>>Guyana</option>
<option value="HT" <?php if($country == 'HT') { echo 'selected="selected"'; } ?>>Haiti</option>
<option value="HM" <?php if($country == 'HM') { echo 'selected="selected"'; } ?>>Heard Island And Mcdonald Islands</option>
<option value="VA" <?php if($country == 'VA') { echo 'selected="selected"'; } ?>>Holy See (Vatican City State)</option>
<option value="HN" <?php if($country == 'HN') { echo 'selected="selected"'; } ?>>Honduras</option>
<option value="HK" <?php if($country == 'HK') { echo 'selected="selected"'; } ?>>Hong Kong</option>
<option value="HU" <?php if($country == 'HU') { echo 'selected="selected"'; } ?>>Hungary</option>
<option value="IS" <?php if($country == 'IS') { echo 'selected="selected"'; } ?>>Iceland</option>
<option value="IN" <?php if($country == 'IN') { echo 'selected="selected"'; } ?>>India</option>
<option value="ID" <?php if($country == 'ID') { echo 'selected="selected"'; } ?>>Indonesia</option>
<option value="IR" <?php if($country == 'IR') { echo 'selected="selected"'; } ?>>Iran, Islamic Republic Of</option>
<option value="IQ" <?php if($country == 'IQ') { echo 'selected="selected"'; } ?>>Iraq</option>
<option value="IE" <?php if($country == 'IE') { echo 'selected="selected"'; } ?>>Ireland</option>
<option value="IM" <?php if($country == 'IM') { echo 'selected="selected"'; } ?>>Isle Of Man</option>
<option value="IL" <?php if($country == 'IL') { echo 'selected="selected"'; } ?>>Israel</option>
<option value="IT" <?php if($country == 'IT') { echo 'selected="selected"'; } ?>>Italy</option>
<option value="JM" <?php if($country == 'JM') { echo 'selected="selected"'; } ?>>Jamaica</option>
<option value="JP" <?php if($country == 'JP') { echo 'selected="selected"'; } ?>>Japan</option>
<option value="JE" <?php if($country == 'JE') { echo 'selected="selected"'; } ?>>Jersey</option>
<option value="JO" <?php if($country == 'JO') { echo 'selected="selected"'; } ?>>Jordan</option>
<option value="KZ" <?php if($country == 'KZ') { echo 'selected="selected"'; } ?>>Kazakhstan</option>
<option value="KE" <?php if($country == 'KE') { echo 'selected="selected"'; } ?>>Kenya</option>
<option value="KI" <?php if($country == 'KI') { echo 'selected="selected"'; } ?>>Kiribati</option>
<option value="KP" <?php if($country == 'KP') { echo 'selected="selected"'; } ?>>Korea, Democratic People'S Republic Of</option>
<option value="KR" <?php if($country == 'KR') { echo 'selected="selected"'; } ?>>Korea, Republic Of</option>
<option value="KW" <?php if($country == 'KW') { echo 'selected="selected"'; } ?>>Kuwait</option>
<option value="KG" <?php if($country == 'KG') { echo 'selected="selected"'; } ?>>Kyrgyzstan</option>
<option value="LA" <?php if($country == 'LA') { echo 'selected="selected"'; } ?>>Lao People'S Democratic Republic</option>
<option value="LV" <?php if($country == 'LV') { echo 'selected="selected"'; } ?>>Latvia</option>
<option value="LB" <?php if($country == 'LB') { echo 'selected="selected"'; } ?>>Lebanon</option>
<option value="LS" <?php if($country == 'LS') { echo 'selected="selected"'; } ?>>Lesotho</option>
<option value="LR" <?php if($country == 'LR') { echo 'selected="selected"'; } ?>>Liberia</option>
<option value="LY" <?php if($country == 'LY') { echo 'selected="selected"'; } ?>>Libyan Arab Jamahiriya</option>
<option value="LI" <?php if($country == 'LI') { echo 'selected="selected"'; } ?>>Liechtenstein</option>
<option value="LT" <?php if($country == 'LT') { echo 'selected="selected"'; } ?>>Lithuania</option>
<option value="LU" <?php if($country == 'LU') { echo 'selected="selected"'; } ?>>Luxembourg</option>
<option value="MO" <?php if($country == 'MO') { echo 'selected="selected"'; } ?>>Macao</option>
<option value="MK" <?php if($country == 'MK') { echo 'selected="selected"'; } ?>>Macedonia, The Former Yugoslav Republic Of</option>
<option value="MG" <?php if($country == 'MG') { echo 'selected="selected"'; } ?>>Madagascar</option>
<option value="MW" <?php if($country == 'MW') { echo 'selected="selected"'; } ?>>Malawi</option>
<option value="MY" <?php if($country == 'MY') { echo 'selected="selected"'; } ?>>Malaysia</option>
<option value="MV" <?php if($country == 'MV') { echo 'selected="selected"'; } ?>>Maldives</option>
<option value="ML" <?php if($country == 'ML') { echo 'selected="selected"'; } ?>>Mali</option>
<option value="MT" <?php if($country == 'MT') { echo 'selected="selected"'; } ?>>Malta</option>
<option value="MH" <?php if($country == 'MH') { echo 'selected="selected"'; } ?>>Marshall Islands</option>
<option value="MQ" <?php if($country == 'MQ') { echo 'selected="selected"'; } ?>>Martinique</option>
<option value="MR" <?php if($country == 'MR') { echo 'selected="selected"'; } ?>>Mauritania</option>
<option value="MU" <?php if($country == 'MU') { echo 'selected="selected"'; } ?>>Mauritius</option>
<option value="YT" <?php if($country == 'YT') { echo 'selected="selected"'; } ?>>Mayotte</option>
<option value="MX" <?php if($country == 'MX') { echo 'selected="selected"'; } ?>>Mexico</option>
<option value="FM" <?php if($country == 'FM') { echo 'selected="selected"'; } ?>>Micronesia, Federated States Of</option>
<option value="MD" <?php if($country == 'MD') { echo 'selected="selected"'; } ?>>Moldova, Republic Of</option>
<option value="MC" <?php if($country == 'MC') { echo 'selected="selected"'; } ?>>Monaco</option>
<option value="MN" <?php if($country == 'MN') { echo 'selected="selected"'; } ?>>Mongolia</option>
<option value="MS" <?php if($country == 'MS') { echo 'selected="selected"'; } ?>>Montserrat</option>
<option value="MA" <?php if($country == 'MA') { echo 'selected="selected"'; } ?>>Morocco</option>
<option value="MZ" <?php if($country == 'MZ') { echo 'selected="selected"'; } ?>>Mozambique</option>
<option value="MM" <?php if($country == 'MM') { echo 'selected="selected"'; } ?>>Myanmar</option>
<option value="NA" <?php if($country == 'NA') { echo 'selected="selected"'; } ?>>Namibia</option>
<option value="NR" <?php if($country == 'NR') { echo 'selected="selected"'; } ?>>Nauru</option>
<option value="NP" <?php if($country == 'NP') { echo 'selected="selected"'; } ?>>Nepal</option>
<option value="NL" <?php if($country == 'NL') { echo 'selected="selected"'; } ?>>Netherlands</option>
<option value="AN" <?php if($country == 'AN') { echo 'selected="selected"'; } ?>>Netherlands Antilles</option>
<option value="NC" <?php if($country == 'NC') { echo 'selected="selected"'; } ?>>New Caledonia</option>
<option value="NZ" <?php if($country == 'NZ') { echo 'selected="selected"'; } ?>>New Zealand</option>
<option value="NI" <?php if($country == 'NI') { echo 'selected="selected"'; } ?>>Nicaragua</option>
<option value="NE" <?php if($country == 'NE') { echo 'selected="selected"'; } ?>>Niger</option>
<option value="NG" <?php if($country == 'NG') { echo 'selected="selected"'; } ?>>Nigeria</option>
<option value="NU" <?php if($country == 'NU') { echo 'selected="selected"'; } ?>>Niue</option>
<option value="NF" <?php if($country == 'NF') { echo 'selected="selected"'; } ?>>Norfolk Island</option>
<option value="MP" <?php if($country == 'MP') { echo 'selected="selected"'; } ?>>Northern Mariana Islands</option>
<option value="NO" <?php if($country == 'NO') { echo 'selected="selected"'; } ?>>Norway</option>
<option value="OM" <?php if($country == 'OM') { echo 'selected="selected"'; } ?>>Oman</option>
<option value="PK" <?php if($country == 'PK') { echo 'selected="selected"'; } ?>>Pakistan</option>
<option value="PW" <?php if($country == 'PW') { echo 'selected="selected"'; } ?>>Palau</option>
<option value="PS" <?php if($country == 'PS') { echo 'selected="selected"'; } ?>>Palestinian Territory, Occupied</option>
<option value="PA" <?php if($country == 'PA') { echo 'selected="selected"'; } ?>>Panama</option>
<option value="PG" <?php if($country == 'PG') { echo 'selected="selected"'; } ?>>Papua New Guinea</option>
<option value="PY" <?php if($country == 'PY') { echo 'selected="selected"'; } ?>>Paraguay</option>
<option value="PE" <?php if($country == 'PE') { echo 'selected="selected"'; } ?>>Peru</option>
<option value="PH" <?php if($country == 'PH') { echo 'selected="selected"'; } ?>>Philippines</option>
<option value="PN" <?php if($country == 'PN') { echo 'selected="selected"'; } ?>>Pitcairn</option>
<option value="PL" <?php if($country == 'PL') { echo 'selected="selected"'; } ?>>Poland</option>
<option value="PT" <?php if($country == 'PT') { echo 'selected="selected"'; } ?>>Portugal</option>
<option value="PR" <?php if($country == 'PR') { echo 'selected="selected"'; } ?>>Puerto Rico</option>
<option value="QA" <?php if($country == 'QA') { echo 'selected="selected"'; } ?>>Qatar</option>
<option value="RE" <?php if($country == 'RE') { echo 'selected="selected"'; } ?>>Reunion</option>
<option value="RO" <?php if($country == 'RO') { echo 'selected="selected"'; } ?>>Romania</option>
<option value="RU" <?php if($country == 'RU') { echo 'selected="selected"'; } ?>>Russian Federation</option>
<option value="RW" <?php if($country == 'RW') { echo 'selected="selected"'; } ?>>Rwanda</option>
<option value="SH" <?php if($country == 'SH') { echo 'selected="selected"'; } ?>>Saint Helena</option>
<option value="KN" <?php if($country == 'KN') { echo 'selected="selected"'; } ?>>Saint Kitts And Nevis</option>
<option value="LC" <?php if($country == 'LC') { echo 'selected="selected"'; } ?>>Saint Lucia</option>
<option value="PM" <?php if($country == 'PM') { echo 'selected="selected"'; } ?>>Saint Pierre And Miquelon</option>
<option value="VC" <?php if($country == 'VC') { echo 'selected="selected"'; } ?>>Saint Vincent And The Grenadines</option>
<option value="WS" <?php if($country == 'WS') { echo 'selected="selected"'; } ?>>Samoa</option>
<option value="SM" <?php if($country == 'SM') { echo 'selected="selected"'; } ?>>San Marino</option>
<option value="ST" <?php if($country == 'ST') { echo 'selected="selected"'; } ?>>Sao Tome And Principe</option>
<option value="SA" <?php if($country == 'SA') { echo 'selected="selected"'; } ?>>Saudi Arabia</option>
<option value="SN" <?php if($country == 'SN') { echo 'selected="selected"'; } ?>>Senegal</option>
<option value="CS" <?php if($country == 'CS') { echo 'selected="selected"'; } ?>>Serbia And Montenegro</option>
<option value="SC" <?php if($country == 'SC') { echo 'selected="selected"'; } ?>>Seychelles</option>
<option value="SL" <?php if($country == 'SL') { echo 'selected="selected"'; } ?>>Sierra Leone</option>
<option value="SG" <?php if($country == 'SG') { echo 'selected="selected"'; } ?>>Singapore</option>
<option value="SK" <?php if($country == 'SK') { echo 'selected="selected"'; } ?>>Slovakia</option>
<option value="SI" <?php if($country == 'SI') { echo 'selected="selected"'; } ?>>Slovenia</option>
<option value="SB" <?php if($country == 'SB') { echo 'selected="selected"'; } ?>>Solomon Islands</option>
<option value="SO" <?php if($country == 'SO') { echo 'selected="selected"'; } ?>>Somalia</option>
<option value="ZA" <?php if($country == 'ZA') { echo 'selected="selected"'; } ?>>South Africa</option>
<option value="GS" <?php if($country == 'GS') { echo 'selected="selected"'; } ?>>South Georgia And The South Sandwich Islands</option>
<option value="ES" <?php if($country == 'ES') { echo 'selected="selected"'; } ?>>Spain</option>
<option value="LK" <?php if($country == 'LK') { echo 'selected="selected"'; } ?>>Sri Lanka</option>
<option value="SD" <?php if($country == 'SD') { echo 'selected="selected"'; } ?>>Sudan</option>
<option value="SR" <?php if($country == 'SR') { echo 'selected="selected"'; } ?>>Suriname</option>
<option value="SJ" <?php if($country == 'SJ') { echo 'selected="selected"'; } ?>>Svalbard And Jan Mayen</option>
<option value="SZ" <?php if($country == 'SZ') { echo 'selected="selected"'; } ?>>Swaziland</option>
<option value="SE" <?php if($country == 'SE') { echo 'selected="selected"'; } ?>>Sweden</option>
<option value="CH" <?php if($country == 'CH') { echo 'selected="selected"'; } ?>>Switzerland</option>
<option value="SY" <?php if($country == 'SY') { echo 'selected="selected"'; } ?>>Syrian Arab Republic</option>
<option value="TW" <?php if($country == 'TW') { echo 'selected="selected"'; } ?>>Taiwan, Province Of China</option>
<option value="TJ" <?php if($country == 'TJ') { echo 'selected="selected"'; } ?>>Tajikistan</option>
<option value="TZ" <?php if($country == 'TZ') { echo 'selected="selected"'; } ?>>Tanzania, United Republic Of</option>
<option value="TH" <?php if($country == 'TH') { echo 'selected="selected"'; } ?>>Thailand</option>
<option value="TL" <?php if($country == 'TL') { echo 'selected="selected"'; } ?>>Timor-Leste</option>
<option value="TG" <?php if($country == 'TG') { echo 'selected="selected"'; } ?>>Togo</option>
<option value="TK" <?php if($country == 'TK') { echo 'selected="selected"'; } ?>>Tokelau</option>
<option value="TO" <?php if($country == 'TO') { echo 'selected="selected"'; } ?>>Tonga</option>
<option value="TT" <?php if($country == 'TT') { echo 'selected="selected"'; } ?>>Trinidad And Tobago</option>
<option value="TN" <?php if($country == 'TN') { echo 'selected="selected"'; } ?>>Tunisia</option>
<option value="TR" <?php if($country == 'TR') { echo 'selected="selected"'; } ?>>Turkey</option>
<option value="TM" <?php if($country == 'TM') { echo 'selected="selected"'; } ?>>Turkmenistan</option>
<option value="TC" <?php if($country == 'TC') { echo 'selected="selected"'; } ?>>Turks And Caicos Islands</option>
<option value="TV" <?php if($country == 'TV') { echo 'selected="selected"'; } ?>>Tuvalu</option>
<option value="UG" <?php if($country == 'UG') { echo 'selected="selected"'; } ?>>Uganda</option>
<option value="UA" <?php if($country == 'UA') { echo 'selected="selected"'; } ?>>Ukraine</option>
<option value="AE" <?php if($country == 'AE') { echo 'selected="selected"'; } ?>>United Arab Emirates</option>
<option value="GB" <?php if($country == 'GB') { echo 'selected="selected"'; } ?>>United Kingdom</option>
<option value="US" <?php if($country == 'US') { echo 'selected="selected"'; } ?>>United States</option>
<option value="UM" <?php if($country == 'UM') { echo 'selected="selected"'; } ?>>United States Minor Outlying Islands</option>
<option value="UY" <?php if($country == 'UY') { echo 'selected="selected"'; } ?>>Uruguay</option>
<option value="UZ" <?php if($country == 'UZ') { echo 'selected="selected"'; } ?>>Uzbekistan</option>
<option value="VU" <?php if($country == 'VU') { echo 'selected="selected"'; } ?>>Vanuatu</option>
<option value="VE" <?php if($country == 'VE') { echo 'selected="selected"'; } ?>>Venezuela</option>
<option value="VN" <?php if($country == 'VN') { echo 'selected="selected"'; } ?>>Viet Nam</option>
<option value="VG" <?php if($country == 'VG') { echo 'selected="selected"'; } ?>>Virgin Islands, British</option>
<option value="VI" <?php if($country == 'VI') { echo 'selected="selected"'; } ?>>Virgin Islands, U.S.</option>
<option value="WF" <?php if($country == 'WF') { echo 'selected="selected"'; } ?>>Wallis And Futuna</option>
<option value="EH" <?php if($country == 'EH') { echo 'selected="selected"'; } ?>>Western Sahara</option>
<option value="YE" <?php if($country == 'YE') { echo 'selected="selected"'; } ?>>Yemen</option>
<option value="ZM" <?php if($country == 'ZM') { echo 'selected="selected"'; } ?>>Zambia</option>
<option value="ZW" <?php if($country == 'ZW') { echo 'selected="selected"'; } ?>>Zimbabwe</option>
</select>

Hopefully I’ve saved some time for other programmers out there who have come across the same issues I have. Be sure to leave a comment and let me know if I was able to help you.


Mar 9

40 Tips for optimizing your php code

Posted on Monday, March 9, 2009 in Programming

If you’re looking for some tips on optimizing your PHP code, here’s a great article I found on another site a few years ago. Unfortunately, that site is no longer up so I decided to post it to help anyone else out who may be looking for ways to optimize PHP code.

  1. If a method can be static, declare it static. Speed improvement is by a factor of 4.
  2. echo is faster than print.
  3. Use echo’s multiple parameters instead of string concatenation.
  4. (more…)