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.