Determine Web Visitors Country of Origin in the Drop Down List using PHP and MySQL Database

With the emergence of online technologies such as the Internet, people and businesses have increased their reliance and use of these mediums as an avenue for commerce as it can be more convenient. During the transaction online, there are times when it is important to preset the web visitor’s country of origin, ZIP code, ISP and domain name at the drop down list to prevent fraud and to ease the complexity of registration task. This article shows you how by using PHP and MYSQL Technology, it can be done.

Let us take a simple example of a user login from Canada and he needs to fill up a shopping cart. The form may be quite complex as some businesses need more information to prevent fraud. In this case, there are needs to preset certain info in the drop down list such as country of origin, ZIP code, ip and domain name of where the users login. As a result, the drop down list in this example will preset to Cananda, with the correct zip code and ip address.

In this tutorial, we use the IP2Location™ IP-Country database to lookup country of origin from the visitor’s IP address. Instead of loading the full database with 50000+ records, we could simplify this tutorial with assumption only two different IP address ranges in the world. IP addresses 0.0.0.0 – 126.255.255.255 originate from United States. Meanwhile, IP addresses 127.0.0.0 – 255.255.255.255 originate from Japan. Here we are creating a database “IP2Location” with table “ip_country” that consists of two IP address range records.

Below are the steps to set up the database for both IPv4 and IPv6 data and the sample codes.

Step 1: Create and connect to 'ip2location' database

CREATE DATABASE ip2location;
USE ip2location;

Step 2: Create 'ip_country' table

CREATE TABLE `ip_country`(
`ip_from` INT(10) UNSIGNED,
`ip_to` INT(10) UNSIGNED,
`country_code` CHAR(2),
`country_name` VARCHAR(64),
INDEX `idx_ip_from` (`ip_from`),
INDEX `idx_ip_to` (`ip_to`),
INDEX `idx_ip_from_to` (`ip_from`, `ip_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

Step 3. Import the IP2Location LITE IP-COUNTRY Database into table ‘ip_country’, you can get the Lite database at https://lite.ip2location.com/database/ip-country

LOAD DATA LOCAL
INFILE 'IP2LOCATION-LITE-DB1.CSV'
INTO TABLE  `ip_country`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;

The full version of IP-Country database is available for subscription at $49/year from https://www.ip2location.com/databases/db1-ip-country. If you have the full version of IP2Location™ IP-Country database, the import process is easier by using the LOAD DATA feature available in MYSQL.

Step 4: Download country information at here. Create ip2location_country_information table:

CREATE TABLE `ip2location_country_information`(
`country_code` CHAR(2),
`capital` VARCHAR(50),
`total_area` DOUBLE,
`population` INT(10) UNSIGNED,
`idd_code` VARCHAR(5),
`currency_code` CHAR(3),
`currency_name` VARCHAR(50),
`lang_code` CHAR(2),
`lang_name` VARCHAR(50),
`cctld` CHAR(2),
INDEX `idx_country_code` (`country_code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 
LOAD DATA LOCAL
INFILE 'IP2LOCATION-COUNTRY-INFORMATION.CSV' INTO TABLE `ip2location_country_information`
CHARACTER SET latin1
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n' IGNORE 1 LINES;

Sample Code:

<?php
    // Replace this MYSQL server variables with actual configuration
    $mysql_server = "mysql_server.com";
    $mysql_user_name = "UserName";
    $mysql_user_pass = "Password";
 
    // Retrieve visitor IP address from server variable REMOTE_ADDR
    $ipaddress = $_SERVER['REMOTE_ADDR'];
 
    // Convert IP address to IP number for querying database
    $ipno = Dot2LongIP($ipaddress);
 
    // Connect to the database server
    $link = mysqli_connect($mysql_server, $mysql_user_name, $mysql_user_pass) or die("Could not connect to MySQL database");
 
    // Connect to the IP2Location database
    mysqli_select_db($link,"ip2location") or die("Could not select database");
 
    // SQL query string to match the recordset that the IP number fall between the valid range
    $query = "SELECT * FROM ip_country WHERE $ipno 
    
    <option value="AF">AFGHANISTAN
    <option value="AL">ALBANIA
    <option value="DZ">ALGERIA
    <option value="AS">AMERICAN SAMOA
    <option value="AD">ANDORRA
    <option value="AO">ANGOLA
    <option value="AI">ANGUILLA
    <option value="AQ">ANTARCTICA
    <option value="AG">ANTIGUA AND BARBUDA
    <option value="AR">ARGENTINA
    <option value="AM">ARMENIA
    <option value="AW">ARUBA
    <option value="AP">ASIA PACIFIC
    <option value="AU">AUSTRALIA
    <option value="AT">AUSTRIA
    <option value="AZ">AZERBAIJAN
    <option value="BS">BAHAMAS
    <option value="BH">BAHRAIN
    <option value="BD">BANGLADESH
    <option value="BB">BARBADOS
    <option value="BY">BELARUS
    <option value="BE">BELGIUM
    <option value="BZ">BELIZE
    <option value="BJ">BENIN
    <option value="BM">BERMUDA
    <option value="BT">BHUTAN
    <option value="BO">BOLIVIA
    <option value="BA">BOSNIA AND HERZEGOWINA
    <option value="BW">BOTSWANA
    <option value="BV">BOUVET ISLAND
    <option value="BR">BRAZIL
    <option value="IO">BRITISH INDIAN OCEAN TERRITORY
    <option value="BN">BRUNEI DARUSSALAM
    <option value="BG">BULGARIA
    <option value="BF">BURKINA FASO
    <option value="BI">BURUNDI
    <option value="KH">CAMBODIA
    <option value="CM">CAMEROON
    <option value="CA">CANADA
    <option value="CV">CAPE VERDE
    <option value="KY">CAYMAN ISLANDS
    <option value="CF">CENTRAL AFRICAN REPUBLIC
    <option value="TD">CHAD
    <option value="CL">CHILE
    <option value="CN">CHINA
    <option value="CX">CHRISTMAS ISLAND
    <option value="CC">COCOS (KEELING) ISLANDS
    <option value="CO">COLOMBIA
    <option value="KM">COMOROS
    <option value="CG">CONGO
    <option value="CD">CONGO, THE DEMOCRATIC REPUBLIC OF THE
    <option value="CK">COOK ISLANDS
    <option value="CR">COSTA RICA
    <option value="CI">COTE D'IVOIRE
    <option value="HR">CROATIA
    <option value="CU">CUBA
    <option value="CY">CYPRUS
    <option value="CZ">CZECH REPUBLIC
    <option value="CS">CZECHOSLOVAKIA (FORMER)
    <option value="DK">DENMARK
    <option value="DJ">DJIBOUTI
    <option value="DM">DOMINICA
    <option value="DO">DOMINICAN REPUBLIC
    <option value="TP">EAST TIMOR
    <option value="EC">ECUADOR
    <option value="EG">EGYPT
    <option value="SV">EL SALVADOR
    <option value="GQ">EQUATORIAL GUINEA
    <option value="ER">ERITREA
    <option value="EE">ESTONIA
    <option value="ET">ETHIOPIA
    <option value="EU">EUROPEAN UNION
    <option value="FK">FALKLAND ISLANDS (MALVINAS)
    <option value="FO">FAROE ISLANDS
    <option value="FJ">FIJI
    <option value="FI">FINLAND
    <option value="FR">FRANCE
    <option value="FX">FRANCE, METROPOLITAN
    <option value="GF">FRENCH GUIANA
    <option value="PF">FRENCH POLYNESIA
    <option value="TF">FRENCH SOUTHERN TERRITORIES
    <option value="GA">GABON
    <option value="GM">GAMBIA
    <option value="GE">GEORGIA
    <option value="DE">GERMANY
    <option value="GH">GHANA
    <option value="GI">GIBRALTAR
    <option value="GB">GREAT BRITAIN
    <option value="GR">GREECE
    <option value="GL">GREENLAND
    <option value="GD">GRENADA
    <option value="GP">GUADELOUPE
    <option value="GU">GUAM
    <option value="GT">GUATEMALA
    <option value="GN">GUINEA
    <option value="GW">GUINEA-BISSAU
    <option value="GY">GUYANA
    <option value="HT">HAITI
    <option value="HM">HEARD ISLAND AND MCDONALD ISLANDS
    <option value="VA">HOLY SEE (VATICAN CITY STATE)
    <option value="HN">HONDURAS
    <option value="HK">HONG KONG
    <option value="HU">HUNGARY
    <option value="IS">ICELAND
    <option value="IN">INDIA
    <option value="ID">INDONESIA
    <option value="IR">IRAN, ISLAMIC REPUBLIC OF
    <option value="IQ">IRAQ
    <option value="IE">IRELAND
    <option value="IL">ISRAEL
    <option value="IT">ITALY
    <option value="JM">JAMAICA
    <option value="JP">JAPAN
    <option value="JO">JORDAN
    <option value="KZ">KAZAKSTAN
    <option value="KE">KENYA
    <option value="KI">KIRIBATI
    <option value="KP">KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF
    <option value="KR">KOREA, REPUBLIC OF
    <option value="KW">KUWAIT
    <option value="KG">KYRGYZSTAN
    <option value="LA">LAO PEOPLE'S DEMOCRATIC REPUBLIC
    <option value="LV">LATVIA
    <option value="LB">LEBANON
    <option value="LS">LESOTHO
    <option value="LR">LIBERIA
    <option value="LY">LIBYAN ARAB JAMAHIRIYA
    <option value="LI">LIECHTENSTEIN
    <option value="LT">LITHUANIA
    <option value="LU">LUXEMBOURG
    <option value="MO">MACAU
    <option value="MK">MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF
    <option value="MG">MADAGASCAR
    <option value="MW">MALAWI
    <option value="MY">MALAYSIA
    <option value="MV">MALDIVES
    <option value="ML">MALI
    <option value="MT">MALTA
    <option value="MH">MARSHALL ISLANDS
    <option value="MQ">MARTINIQUE
    <option value="MR">MAURITANIA
    <option value="MU">MAURITIUS
    <option value="YT">MAYOTTE
    <option value="MX">MEXICO
    <option value="FM">MICRONESIA, FEDERATED STATES OF
    <option value="MD">MOLDOVA, REPUBLIC OF
    <option value="MC">MONACO
    <option value="MN">MONGOLIA
    <option value="MS">MONTSERRAT
    <option value="MA">MOROCCO
    <option value="MZ">MOZAMBIQUE
    <option value="MM">MYANMAR
    <option value="NA">NAMIBIA
    <option value="NR">NAURU
    <option value="NP">NEPAL
    <option value="NL">NETHERLANDS
    <option value="AN">NETHERLANDS ANTILLES
    <option value="NC">NEW CALEDONIA
    <option value="NZ">NEW ZEALAND
    <option value="NI">NICARAGUA
    <option value="NE">NIGER
    <option value="NG">NIGERIA
    <option value="NU">NIUE
    <option value="NF">NORFOLK ISLAND
    <option value="MP">NORTHERN MARIANA ISLANDS
    <option value="NO">NORWAY
    <option value="OM">OMAN
    <option value="PK">PAKISTAN
    <option value="PW">PALAU
    <option value="PS">PALESTINIAN TERRITORY, OCCUPIED
    <option value="PA">PANAMA
    <option value="PG">PAPUA NEW GUINEA
    <option value="PY">PARAGUAY
    <option value="PE">PERU
    <option value="PH">PHILIPPINES
    <option value="PN">PITCAIRN
    <option value="PL">POLAND
    <option value="PT">PORTUGAL
    <option value="PR">PUERTO RICO
    <option value="QA">QATAR
    <option value="RE">REUNION
    <option value="RO">ROMANIA
    <option value="SU">RUSSIAN FEDERATION
    <option value="RW">RWANDA
    <option value="SH">SAINT HELENA
    <option value="KN">SAINT KITTS AND NEVIS
    <option value="LC">SAINT LUCIA
    <option value="PM">SAINT PIERRE AND MIQUELON
    <option value="VC">SAINT VINCENT AND THE GRENADINES
    <option value="WS">SAMOA
    <option value="SM">SAN MARINO
    <option value="ST">SAO TOME AND PRINCIPE
    <option value="SA">SAUDI ARABIA
    <option value="SN">SENEGAL
    <option value="YU">SERBIA AND MONTENEGRO
    <option value="SC">SEYCHELLES
    <option value="SL">SIERRA LEONE
    <option value="SG">SINGAPORE
    <option value="SK">SLOVAKIA
    <option value="SI">SLOVENIA
    <option value="SB">SOLOMON ISLANDS
    <option value="SO">SOMALIA
    <option value="ZA">SOUTH AFRICA
    <option value="GS">SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS
    <option value="ES">SPAIN
    <option value="LK">SRI LANKA
    <option value="SD">SUDAN
    <option value="SR">SURINAME
    <option value="SJ">SVALBARD AND JAN MAYEN
    <option value="SZ">SWAZILAND
    <option value="SE">SWEDEN
    <option value="CH">SWITZERLAND
    <option value="SY">SYRIAN ARAB REPUBLIC
    <option value="TW">TAIWAN, PROVINCE OF CHINA
    <option value="TJ">TAJIKISTAN
    <option value="TZ">TANZANIA, UNITED REPUBLIC OF
    <option value="TH">THAILAND
    <option value="TG">TOGO
    <option value="TK">TOKELAU
    <option value="TO">TONGA
    <option value="TT">TRINIDAD AND TOBAGO
    <option value="TN">TUNISIA
    <option value="TR">TURKEY
    <option value="TM">TURKMENISTAN
    <option value="TC">TURKS AND CAICOS ISLANDS
    <option value="TV">TUVALU
    <option value="UG">UGANDA
    <option value="UA">UKRAINE
    <option value="AE">UNITED ARAB EMIRATES
    <option value="UK">UNITED KINGDOM
    <option value="US">UNITED STATES
    <option value="UM">UNITED STATES MINOR OUTLYING ISLANDS
    <option value="UY">URUGUAY
    <option value="UZ">UZBEKISTAN
    <option value="VU">VANUATU
    <option value="VE">VENEZUELA
    <option value="VN">VIET NAM
    <option value="VG">VIRGIN ISLANDS, BRITISH
    <option value="VI">VIRGIN ISLANDS, U.S.
    <option value="WF">WALLIS AND FUTUNA
    <option value="EH">WESTERN SAHARA
    <option value="YE">YEMEN
    <option value="ZM">ZAMBIA
    <option value="ZW">ZIMBABWE
    
	

Step 1: Create and connect to 'ip2location' database

CREATE DATABASE ip2location;
USE ip2location;

Step 2: Create 'ip_country' table

CREATE TABLE `ip_country`(
`ip_from` DECIMAL(39,0) UNSIGNED,
`ip_to` DECIMAL(39,0) UNSIGNED,
`country_code` CHAR(2),
`country_name` VARCHAR(64),
INDEX `idx_ip_from` (`ip_from`),
INDEX `idx_ip_to` (`ip_to`),
INDEX `idx_ip_from_to` (`ip_from`, `ip_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

Step 3. Import the IP2Location LITE IP-COUNTRY IPV6 Database into table ‘ip_country’, you can get the Lite database at https://lite.ip2location.com/database/ip-country

LOAD DATA LOCAL
INFILE 'IP2LOCATION-LITE-DB1.IPV6.CSV'
INTO TABLE  `ip_country`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;

The full version of IP-Country database is available for subscription at $49/year from https://www.ip2location.com/databases/db1-ip-country. If you have the full version of IP2Location™ IP-Country database, the import process is easier by using the LOAD DATA feature available in MYSQL.

Step 4: Download country information at here. Create ip2location_country_information table:

CREATE TABLE `ip2location_country_information`(
`country_code` CHAR(2),
`capital` VARCHAR(50),
`total_area` DOUBLE,
`population` INT(10) UNSIGNED,
`idd_code` VARCHAR(5),
`currency_code` CHAR(3),
`currency_name` VARCHAR(50),
`lang_code` CHAR(2),
`lang_name` VARCHAR(50),
`cctld` CHAR(2),
INDEX `idx_country_code` (`country_code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 
LOAD DATA LOCAL
INFILE 'IP2LOCATION-COUNTRY-INFORMATION.CSV' INTO TABLE `ip2location_country_information`
CHARACTER SET latin1
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n' IGNORE 1 LINES;

Sample Code:

<?php
    // Replace this MYSQL server variables with actual configuration
    $mysql_server = "mysql_server.com";
    $mysql_user_name = "UserName";
    $mysql_user_pass = "Password";
 
    // Retrieve visitor IP address from server variable REMOTE_ADDR
    $ipaddress = getenv(REMOTE_ADDR);
 
    // Convert IP address to IP number for querying database
    $ipno = Dot2LongIPv6($ipaddress);
     
    // Connect to the database server
    $link = mysqli_connect($mysql_server, $mysql_user_name, $mysql_user_pass) or die("Could not connect to MySQL database");
 
    // Connect to the IP2Location database
    mysqli_select_db($link,"ip2location") or die("Could not select database");
 
    // SQL query string to match the recordset that the IP number fall between the valid range
    $query = "SELECT * FROM ip_country WHERE $ipno = 0){
            $bin = sprintf("%08b", (ord($int[$bits])));
            if($ipv6long){
                $ipv6long = $bin . $ipv6long;
            }
            else{
                $ipv6long = $bin;
            }
            $bits--;
        }
        $ipv6long = gmp_strval(gmp_init($ipv6long, 2), 10);
        return $ipv6long;                   
    }
?>
    
    <option value="AF">AFGHANISTAN
    <option value="AL">ALBANIA
    <option value="DZ">ALGERIA
    <option value="AS">AMERICAN SAMOA
    <option value="AD">ANDORRA
    <option value="AO">ANGOLA
    <option value="AI">ANGUILLA
    <option value="AQ">ANTARCTICA
    <option value="AG">ANTIGUA AND BARBUDA
    <option value="AR">ARGENTINA
    <option value="AM">ARMENIA
    <option value="AW">ARUBA
    <option value="AP">ASIA PACIFIC
    <option value="AU">AUSTRALIA
    <option value="AT">AUSTRIA
    <option value="AZ">AZERBAIJAN
    <option value="BS">BAHAMAS
    <option value="BH">BAHRAIN
    <option value="BD">BANGLADESH
    <option value="BB">BARBADOS
    <option value="BY">BELARUS
    <option value="BE">BELGIUM
    <option value="BZ">BELIZE
    <option value="BJ">BENIN
    <option value="BM">BERMUDA
    <option value="BT">BHUTAN
    <option value="BO">BOLIVIA
    <option value="BA">BOSNIA AND HERZEGOWINA
    <option value="BW">BOTSWANA
    <option value="BV">BOUVET ISLAND
    <option value="BR">BRAZIL
    <option value="IO">BRITISH INDIAN OCEAN TERRITORY
    <option value="BN">BRUNEI DARUSSALAM
    <option value="BG">BULGARIA
    <option value="BF">BURKINA FASO
    <option value="BI">BURUNDI
    <option value="KH">CAMBODIA
    <option value="CM">CAMEROON
    <option value="CA">CANADA
    <option value="CV">CAPE VERDE
    <option value="KY">CAYMAN ISLANDS
    <option value="CF">CENTRAL AFRICAN REPUBLIC
    <option value="TD">CHAD
    <option value="CL">CHILE
    <option value="CN">CHINA
    <option value="CX">CHRISTMAS ISLAND
    <option value="CC">COCOS (KEELING) ISLANDS
    <option value="CO">COLOMBIA
    <option value="KM">COMOROS
    <option value="CG">CONGO
    <option value="CD">CONGO, THE DEMOCRATIC REPUBLIC OF THE
    <option value="CK">COOK ISLANDS
    <option value="CR">COSTA RICA
    <option value="CI">COTE D'IVOIRE
    <option value="HR">CROATIA
    <option value="CU">CUBA
    <option value="CY">CYPRUS
    <option value="CZ">CZECH REPUBLIC
    <option value="CS">CZECHOSLOVAKIA (FORMER)
    <option value="DK">DENMARK
    <option value="DJ">DJIBOUTI
    <option value="DM">DOMINICA
    <option value="DO">DOMINICAN REPUBLIC
    <option value="TP">EAST TIMOR
    <option value="EC">ECUADOR
    <option value="EG">EGYPT
    <option value="SV">EL SALVADOR
    <option value="GQ">EQUATORIAL GUINEA
    <option value="ER">ERITREA
    <option value="EE">ESTONIA
    <option value="ET">ETHIOPIA
    <option value="EU">EUROPEAN UNION
    <option value="FK">FALKLAND ISLANDS (MALVINAS)
    <option value="FO">FAROE ISLANDS
    <option value="FJ">FIJI
    <option value="FI">FINLAND
    <option value="FR">FRANCE
    <option value="FX">FRANCE, METROPOLITAN
    <option value="GF">FRENCH GUIANA
    <option value="PF">FRENCH POLYNESIA
    <option value="TF">FRENCH SOUTHERN TERRITORIES
    <option value="GA">GABON
    <option value="GM">GAMBIA
    <option value="GE">GEORGIA
    <option value="DE">GERMANY
    <option value="GH">GHANA
    <option value="GI">GIBRALTAR
    <option value="GB">GREAT BRITAIN
    <option value="GR">GREECE
    <option value="GL">GREENLAND
    <option value="GD">GRENADA
    <option value="GP">GUADELOUPE
    <option value="GU">GUAM
    <option value="GT">GUATEMALA
    <option value="GN">GUINEA
    <option value="GW">GUINEA-BISSAU
    <option value="GY">GUYANA
    <option value="HT">HAITI
    <option value="HM">HEARD ISLAND AND MCDONALD ISLANDS
    <option value="VA">HOLY SEE (VATICAN CITY STATE)
    <option value="HN">HONDURAS
    <option value="HK">HONG KONG
    <option value="HU">HUNGARY
    <option value="IS">ICELAND
    <option value="IN">INDIA
    <option value="ID">INDONESIA
    <option value="IR">IRAN, ISLAMIC REPUBLIC OF
    <option value="IQ">IRAQ
    <option value="IE">IRELAND
    <option value="IL">ISRAEL
    <option value="IT">ITALY
    <option value="JM">JAMAICA
    <option value="JP">JAPAN
    <option value="JO">JORDAN
    <option value="KZ">KAZAKSTAN
    <option value="KE">KENYA
    <option value="KI">KIRIBATI
    <option value="KP">KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF
    <option value="KR">KOREA, REPUBLIC OF
    <option value="KW">KUWAIT
    <option value="KG">KYRGYZSTAN
    <option value="LA">LAO PEOPLE'S DEMOCRATIC REPUBLIC
    <option value="LV">LATVIA
    <option value="LB">LEBANON
    <option value="LS">LESOTHO
    <option value="LR">LIBERIA
    <option value="LY">LIBYAN ARAB JAMAHIRIYA
    <option value="LI">LIECHTENSTEIN
    <option value="LT">LITHUANIA
    <option value="LU">LUXEMBOURG
    <option value="MO">MACAU
    <option value="MK">MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF
    <option value="MG">MADAGASCAR
    <option value="MW">MALAWI
    <option value="MY">MALAYSIA
    <option value="MV">MALDIVES
    <option value="ML">MALI
    <option value="MT">MALTA
    <option value="MH">MARSHALL ISLANDS
    <option value="MQ">MARTINIQUE
    <option value="MR">MAURITANIA
    <option value="MU">MAURITIUS
    <option value="YT">MAYOTTE
    <option value="MX">MEXICO
    <option value="FM">MICRONESIA, FEDERATED STATES OF
    <option value="MD">MOLDOVA, REPUBLIC OF
    <option value="MC">MONACO
    <option value="MN">MONGOLIA
    <option value="MS">MONTSERRAT
    <option value="MA">MOROCCO
    <option value="MZ">MOZAMBIQUE
    <option value="MM">MYANMAR
    <option value="NA">NAMIBIA
    <option value="NR">NAURU
    <option value="NP">NEPAL
    <option value="NL">NETHERLANDS
    <option value="AN">NETHERLANDS ANTILLES
    <option value="NC">NEW CALEDONIA
    <option value="NZ">NEW ZEALAND
    <option value="NI">NICARAGUA
    <option value="NE">NIGER
    <option value="NG">NIGERIA
    <option value="NU">NIUE
    <option value="NF">NORFOLK ISLAND
    <option value="MP">NORTHERN MARIANA ISLANDS
    <option value="NO">NORWAY
    <option value="OM">OMAN
    <option value="PK">PAKISTAN
    <option value="PW">PALAU
    <option value="PS">PALESTINIAN TERRITORY, OCCUPIED
    <option value="PA">PANAMA
    <option value="PG">PAPUA NEW GUINEA
    <option value="PY">PARAGUAY
    <option value="PE">PERU
    <option value="PH">PHILIPPINES
    <option value="PN">PITCAIRN
    <option value="PL">POLAND
    <option value="PT">PORTUGAL
    <option value="PR">PUERTO RICO
    <option value="QA">QATAR
    <option value="RE">REUNION
    <option value="RO">ROMANIA
    <option value="SU">RUSSIAN FEDERATION
    <option value="RW">RWANDA
    <option value="SH">SAINT HELENA
    <option value="KN">SAINT KITTS AND NEVIS
    <option value="LC">SAINT LUCIA
    <option value="PM">SAINT PIERRE AND MIQUELON
    <option value="VC">SAINT VINCENT AND THE GRENADINES
    <option value="WS">SAMOA
    <option value="SM">SAN MARINO
    <option value="ST">SAO TOME AND PRINCIPE
    <option value="SA">SAUDI ARABIA
    <option value="SN">SENEGAL
    <option value="YU">SERBIA AND MONTENEGRO
    <option value="SC">SEYCHELLES
    <option value="SL">SIERRA LEONE
    <option value="SG">SINGAPORE
    <option value="SK">SLOVAKIA
    <option value="SI">SLOVENIA
    <option value="SB">SOLOMON ISLANDS
    <option value="SO">SOMALIA
    <option value="ZA">SOUTH AFRICA
    <option value="GS">SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS
    <option value="ES">SPAIN
    <option value="LK">SRI LANKA
    <option value="SD">SUDAN
    <option value="SR">SURINAME
    <option value="SJ">SVALBARD AND JAN MAYEN
    <option value="SZ">SWAZILAND
    <option value="SE">SWEDEN
    <option value="CH">SWITZERLAND
    <option value="SY">SYRIAN ARAB REPUBLIC
    <option value="TW">TAIWAN, PROVINCE OF CHINA
    <option value="TJ">TAJIKISTAN
    <option value="TZ">TANZANIA, UNITED REPUBLIC OF
    <option value="TH">THAILAND
    <option value="TG">TOGO
    <option value="TK">TOKELAU
    <option value="TO">TONGA
    <option value="TT">TRINIDAD AND TOBAGO
    <option value="TN">TUNISIA
    <option value="TR">TURKEY
    <option value="TM">TURKMENISTAN
    <option value="TC">TURKS AND CAICOS ISLANDS
    <option value="TV">TUVALU
    <option value="UG">UGANDA
    <option value="UA">UKRAINE
    <option value="AE">UNITED ARAB EMIRATES
    <option value="UK">UNITED KINGDOM
    <option value="US">UNITED STATES
    <option value="UM">UNITED STATES MINOR OUTLYING ISLANDS
    <option value="UY">URUGUAY
    <option value="UZ">UZBEKISTAN
    <option value="VU">VANUATU
    <option value="VE">VENEZUELA
    <option value="VN">VIET NAM
    <option value="VG">VIRGIN ISLANDS, BRITISH
    <option value="VI">VIRGIN ISLANDS, U.S.
    <option value="WF">WALLIS AND FUTUNA
    <option value="EH">WESTERN SAHARA
    <option value="YE">YEMEN
    <option value="ZM">ZAMBIA
    <option value="ZW">ZIMBABWE
    

Was this article helpful?

Related Articles