Determine Web Visitors Country of Origin in the Drop Down List using ASP and MS-SQL Database
Determine Web Visitors Country of Origin in the Drop Down List using ASP and MS-SQL Database
Hexasoft Development Sdn. Bhd. (645996-K) 1-2-15 Mayang Mall Complex, Jalan Mayang Pasir 1, 11950 Bandar Bayan Baru, Penang, Malaysia. { sales@ip2location.com }
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 ASP and MS-SQL 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. The full version of IP-Country database is available for subscription at $49/year from http://ip2location.com. If you have the full version of IP2Location? IP-Country database, import process is easy done by using the Database Transformation Service (DTS) in MS-SQL.
Sample Codes in ASP and MS-SQL ------------------------------
"-" Then Response.Write "" & CountryLongName & ""& vbCrLf End If
' function to convert IP address to IP number Function Dot2LongIP (ByVal DottedIP) Dim i, pos Dim PrevPos, num If DottedIP = "" Then Dot2LongIP = 0 Else For i = 1 To 4 pos = InStr(PrevPos + 1, DottedIP, ".", 1) If i = 4 Then pos = Len(DottedIP) + 1 End If num = Int(Mid(DottedIP, PrevPos + 1, pos - PrevPos - 1)) PrevPos = pos Dot2LongIP = ((num Mod 256) * (256 ^ (4 - i))) + Dot2LongIP Next End If End Function %> AFGHANISTAN ALBANIA ALGERIA AMERICAN SAMOA ANDORRA ANGOLA ANGUILLA ANTARCTICA ANTIGUA AND BARBUDA ARGENTINA ARMENIA ARUBA ASIA PACIFIC AUSTRALIA AUSTRIA AZERBAIJAN BAHAMAS BAHRAIN BANGLADESH BARBADOS BELARUS BELGIUM BELIZE BENIN BERMUDA BHUTAN BOLIVIA BOSNIA AND HERZEGOWINA 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, THE DEMOCRATIC REPUBLIC OF THE COOK ISLANDS COSTA RICA COTE D'IVOIRE CROATIA CUBA CYPRUS CZECH REPUBLIC CZECHOSLOVAKIA (FORMER) DENMARK DJIBOUTI DOMINICA DOMINICAN REPUBLIC EAST TIMOR ECUADOR EGYPT EL SALVADOR EQUATORIAL GUINEA ERITREA ESTONIA ETHIOPIA EUROPEAN UNION FALKLAND ISLANDS (MALVINAS) FAROE ISLANDS FIJI FINLAND FRANCE FRANCE, METROPOLITAN FRENCH GUIANA FRENCH POLYNESIA FRENCH SOUTHERN TERRITORIES GABON GAMBIA GEORGIA GERMANY GHANA GIBRALTAR GREAT BRITAIN GREECE GREENLAND GRENADA GUADELOUPE GUAM GUATEMALA GUINEA GUINEA-BISSAU GUYANA HAITI HEARD ISLAND AND MCDONALD ISLANDS HOLY SEE (VATICAN CITY STATE) HONDURAS HONG KONG HUNGARY ICELAND INDIA INDONESIA IRAN, ISLAMIC REPUBLIC OF IRAQ IRELAND ISRAEL ITALY JAMAICA JAPAN JORDAN KAZAKSTAN KENYA KIRIBATI KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF KOREA, REPUBLIC OF KUWAIT KYRGYZSTAN LAO PEOPLE'S DEMOCRATIC REPUBLIC LATVIA LEBANON LESOTHO LIBERIA LIBYAN ARAB JAMAHIRIYA LIECHTENSTEIN LITHUANIA LUXEMBOURG MACAU MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF MADAGASCAR MALAWI MALAYSIA MALDIVES MALI MALTA MARSHALL ISLANDS MARTINIQUE MAURITANIA MAURITIUS MAYOTTE MEXICO MICRONESIA, FEDERATED STATES OF MOLDOVA, REPUBLIC OF MONACO MONGOLIA 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 TERRITORY, OCCUPIED PANAMA PAPUA NEW GUINEA PARAGUAY PERU PHILIPPINES PITCAIRN POLAND PORTUGAL PUERTO RICO QATAR REUNION 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 AND MONTENEGRO 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 SWAZILAND SWEDEN SWITZERLAND SYRIAN ARAB REPUBLIC TAIWAN, PROVINCE OF CHINA TAJIKISTAN TANZANIA, UNITED REPUBLIC OF THAILAND TOGO TOKELAU TONGA TRINIDAD AND TOBAGO TUNISIA TURKEY TURKMENISTAN TURKS AND CAICOS ISLANDS TUVALU UGANDA UKRAINE UNITED ARAB EMIRATES UNITED KINGDOM UNITED STATES UNITED STATES MINOR OUTLYING ISLANDS URUGUAY UZBEKISTAN VANUATU VENEZUELA VIET NAM VIRGIN ISLANDS, BRITISH VIRGIN ISLANDS, U.S. WALLIS AND FUTUNA WESTERN SAHARA YEMEN ZAMBIA ZIMBABWE
Comment on "Determine Web Visitors Country of Origin in the Drop Down List using ASP and MS-SQL Database"
Different Experiences In Hotel Boeken
Amsterdam is the capital and main city of the Kingdom of the Netherlands. The town is cut by about 40 canals that are flanked by streets and crossed by 400 bridges. The canals give the town its nickname; "Venice of the North". Amsterdam has several new inhabitants from former Dutch colonies, including Indonesia and Suriname.
International Cost of Living Trends 2009
The objective of expatriate pay programs is to ensure that employee spending power and standard of living is maintained irrespective of global location How to achieve this has been an issue many organizations spend considerable time on
Sino-Forest Announces Resignation of Auditor
TORONTO, April 5, 2012 /PRNewswire/ - Sino-Forest Corporation ("Sino-Forest" or
the "Company") (TSX: TRE) announced today that Ernst & Young LLP
("E&Y") has notified the Company that it has resigned as the Company's
auditor effective April 4, 2012. In its resignation letter to the
Company, E&Y noted that the Company had not prepared December 31, 2011
consolidated financial statements for audit and that, in the Company's
March 30, 2012 filing under the Companies' Creditors Arrangement Act, Sino-Forest said that it remained unable to satisfactorily address
outstanding issues in relation to its 2011 annual financial statements.
Sino-Forest intends to issue a press release containing the information
required by ...
Wireless broadband and low-cost CDMA mobile phone business to promote the Latin American-CDMA, mobile phones, wireless broadband - Communications Indu
Recently announced the deployment of mobile broadband, international roaming services, cheap cell phones and CDMA450 commercial success, has become the promotion of CDMA2000 ® in Latin America and the Caribbean, a key factor in growth. CDMA2000 operators in the region, the number has increased to 62, more than 66 million subscribers. Of which 25 networks (about 40% of the total network) has been upgraded to EV-DO to provide high-speed mobile broadband services. Another 14 networks will be upgraded within a year, EV-DO. In the past year, the number of international roaming agreements in the region has increased by 10%, are now available for 50 dollars CDMA mobile phone Achieve more than a dozen models. 7 CDMA450 network into commercial opera ...
Refining Industry Outlook in South and Central America, 2012 - Capacity Analysis, Forecasts and Details of All Operating and Planned Refineries to 201
NEW YORK, March 14, 2012 /PRNewswire/ -- Reportlinker.com announces that a new market research report is available in its catalogue:
Refining Industry Outlook in South and Central America, 2012 - Capacity Analysis, Forecasts and Details of All Operating and Planned Refineries to 2016
Refining Industry Outlook in South and Central America, 2012 - Capacity Analysis, Forecasts and Details of All Operating and Planned Refineries to 2016
Summary
GlobalData's energy offering, "Re ...
Sino-Forest Granted CCAA Order
TORONTO, March 30, 2012 /PRNewswire/ - Sino-Forest Corporation ("Sino-Forest"
or the "Company") (TSX:TRE) announced that, further to its news release
issued earlier today, the Company has obtained an initial order (the
"Order") from the Ontario Superior Court of Justice (the "Court") for
creditor protection pursuant to the provisions of the Companies' Creditors Arrangement Act ("CCAA").
Under the terms of the Order, FTI Consulting Canada Inc.