Previous Code Entry
Left Arrow
No Captcha ReCaptcha 2.0 with ASP Classic
Current Code Entry
Next Code Entry
Classic ASP Database Driven Select Menu (Dropdown Menu)
Right Arrow
ASP Classic check if Zip Code exist, if not show message.
Article Entry Date: July 19,2022 @ 07:54:00 / Last Updated On: August 14,2022 @ 05:55:41
In An ASP Classic US Zip Code lookup form, find any zip code in the US in this easy-to-use code.
In this example, we will be using [ASP Classic].
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: Check the value from the form 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 letting them know it does not exist.

The database comes with over 5,000 Zip Code entries and is available through the [Source Code] below.

The script we use to protect ourselves from XSS and SQL Injections is also available below and demonstrated in the demo code.
Example of the ProtectXSS code.