Previous
Left Arrow
No Captcha ReCaptcha 2.0 with ASP Classic
Current Code Entry
Next
CFF Coding Source - 
Classic ASP Database Driven Select Menu (Dropdown Menu)
  • ASP Classic check if Zip Code exists, if not show message

    Article Entry Date: July 19,2022 @ 07:54:00 / Last Updated On: February 4,2026 @ 03:01:39
  • ASP Classic check if Zip Code exists, if not show message : Image Name | CFF Coding Source
    ASP Classic check if Zip Code exists, if not show message
Using [ASP Classic] [VB] version, we will look up the US Zip Code to find any zip code in the US in this easy-to-use code.

In this example, we will use [ASP Classic] with [VB].
When the user enters their Zip Code into the form, we will do the following.

(Protecting our Database from XSS Attacks)
Date: 07-30-2022 - Name changed of Function from ProtectSQL to ProtectXSS, as it was brought to my attention that saying SQL was misleading.

#1: Use a function that will protect our database from [XSS] attacks called: [ProtectXSS]
#2: Validate the form value against our database.
#3: Protect our Database from [SQL injection] using [Parameterized Queries].
#4: If the Zip Code [Does exist], we will display a message to the user, letting them know that the Zip Code exists
#5: If the ZIP Code [Does not exist], we will display a message indicating it does not exist.

The database includes over 5,000 ZIP Code entries and is available through this Article here: A SQL Server Script for Zip Codes.«
[Section #1:]
The Script will also use a protection method to prevent [XSS] and [SQL Injection], as shown below and demonstrated in the demo code.
Example of the [ProtectXSS] code.


[Section #2:]
To protect ourselves from SQL Injections, we need to use [Parameterized Queries].
The following unsafe query was rapidly available when I first started learning ASP Classic.
(You can find examples of this poor code all over forums dating back to the late 90s and 2000s.


A protected Query for ASP Classic.


Get the Zip Codes database from here: A SQL Server Script for Zip Codes.«

Other Articles Related to this Entry.



A SQL Server Script for Zip Codes.«
ASP.NET (VB Version) check if Zip Code exists. If not, show a message«
ASP.NET (C# Version) check if Zip Code exists. If not, show a message.«