Jump to content

What would be the best way to handle these flag images?


jakebur01

Recommended Posts

I am going to create a directory within my images directory called flags. This flags directory will contain little gif's of different countries.

 

I am trying to figure out how I should name the images as I save them.

 

Like I will be pulling the flag image based on the country name. But, I do not know how it will handle the spaces in the word. And how it would handle characters like this... Virgin Islands (British) ..... or commas Macedonia, Former Yugoslav Republic Of

 

example // like


sql ..... select statement

while loop{

$image=$row[country];

(@file_exists('images/flags/'.($image).'.gif'))
    {
        echo '<td><img src=\'images/flags/'.$image.'.gif\' border=0 width=60 height=40>
     }

{

 

this is the way the countries look in the select form when they sign up.... so this is what they will look like in the db

Afghanistan

Åland Islands

Albania

Algeria

American Samoa

Andorra

Angola

Anguilla

Antarctica

Antigua and Barbuda

Argentina

Armenia

Aruba

Australia

Austria

Azerbaijan

Bahamas

Bahrain

Bangladesh

Barbados

Belarus

Belgium

Belize

Benin

Bermuda

Bhutan

Bolivia

Bosnia and Herzegovina

Botswana

Bouvet Island

Brazil

British Indian Ocean territory

Brunei Darussalam

Bulgaria

Burkina Faso

Burundi

Cambodia

Cameroon

Canada

Cape Verde

Cayman Islands

Central African Republic

Chad

Chile

China

Christmas Island

Cocos (Keeling) Islands

Colombia

Comoros

Congo

Congo, Democratic Republic

Cook Islands

Costa Rica

Côte d'Ivoire (Ivory Coast)

Croatia (Hrvatska)

Cuba

Cyprus

Czech Republic

Denmark

Djibouti

Dominica

Dominican Republic

East Timor

Ecuador

Egypt

El Salvador

Equatorial Guinea

Eritrea

Estonia

Ethiopia

Falkland Islands

Faroe Islands

Fiji

Finland

France

French Guiana

French Polynesia

French Southern Territories

Gabon

Gambia

Georgia

Germany

Ghana

Gibraltar

Greece

Greenland

Grenada

Guadeloupe

Guam

Guatemala

Guinea

Guinea-Bissau

Guyana

Haiti

Heard and McDonald Islands

Honduras

Hong Kong

Hungary

Iceland

India

Indonesia

Iran

Iraq

Ireland

Israel

Italy

Jamaica

Japan

Jordan

Kazakhstan

Kenya

Kiribati

Korea (north)

Korea (south)

Kuwait

Kyrgyzstan

Lao People's Democratic Republic

Latvia

Lebanon

Lesotho

Liberia

Libyan Arab Jamahiriya

Liechtenstein

Lithuania

Luxembourg

Macao

Macedonia, Former Yugoslav Republic Of

Madagascar

Malawi

Malaysia

Maldives

Mali

Malta

Marshall Islands

Martinique

Mauritania

Mauritius

Mayotte

Mexico

Micronesia

Moldova

Monaco

MongoliaMontenegro

Montserrat

Morocco

Mozambique

Myanmar

Namibia

Nauru

Nepal

Netherlands

Netherlands Antilles

New Caledonia

New Zealand

Nicaragua

Niger

Nigeria

Niue

Norfolk Island

Northern Mariana Islands

Norway

Oman

Pakistan

Palau

Palestinian Territories

Panama

Papua New Guinea

Paraguay

Peru

Philippines

Pitcairn

Poland

Portugal

Puerto Rico

Qatar

Réunion

Romania

Russian Federation

Rwanda

Saint Helena

Saint Kitts and Nevis

Saint Lucia

Saint Pierre and Miquelon

Saint Vincent and the Grenadines

Samoa

San Marino

Sao Tome and Principe

Saudi Arabia

Senegal

Serbia

Seychelles

Sierra Leone

Singapore

Slovakia

Slovenia

Solomon Islands

Somalia

South Africa

South Georgia and the South Sandwich Islands

Spain

Sri Lanka

Sudan

Suriname

Svalbard and Jan Mayen Islands

Swaziland

Sweden

Switzerland

Syria

Taiwan

Tajikistan

Tanzania

Thailand

Togo

Tokelau

Tonga

Trinidad and Tobago

Tunisia

Turkey

Turkmenistan

Turks and Caicos Islands

Tuvalu

Uganda

Ukraine

United Arab Emirates

United Kingdom

United States of America

Uruguay

Uzbekistan

Vanuatu

Vatican City

Venezuela

Vietnam

Virgin Islands (British)

Virgin Islands (US)

Wallis and Futuna Islands

Western Sahara

Yemen

Zaire

Zambia

Zimbabwe 

 

Link to comment
Share on other sites

Put the countries into a database or even a flat file with numeric associations.  Then, use the numbers as the value in your drop down.

 

Then, just name the flags the number of the country.  (Or you could use country codes like US or UK if you had a list.)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.