How to create a [
Reusable] Function in [
ASP Classic]
Making a reusable function allows you to use the function anywhere within your code project.
I've been using this function for many years to help protect against [
XSS injections] and have just used it in everything.
Copy the code below, copy and paste it into an empty page, and save it as Decoding.asp.
Encoding = Change the original characters.
Decoding = Change back to original characters.
To reuse this function, add an INCLUDE FILE to all pages on which you want to use the function.
The above example will
#1: replace the Parentheses with {
curly brackets} and add underscores where spaces are at.
Output: Test_{This_is_a_test}
#2: replace the {
curly brackets} with Parentheses and remove the underscores.
Output: Test (This is a test);