To all who replied and offered advice, thank you very much. Sorry for the
delay in responding. Good tips from all, thanks again.
Julie
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get
Hello all,
I'm trying to screen out bad stuff sent to my scripts in the form fields and
I know there has to be a better way to do it than this:
cfif lcase(form.First_Name) CONTAINS 'http'
OR lcase(form.First_Name) CONTAINS 'script'
OR lcase(form.First_Name) CONTAINS 'img'
OR
lcase(form.First_Name)
First of all, you could avoid calling the lcase function 6 times on the
same expression:
store lcase(form.First_Name) once for all in one variable, and use this
variable in your tests.
But this is just a general consideration.
What you need here is some regExp, ie
cfif
cfelse
Bo :O(
/cfif
Adrian
-Original Message-
From: Julie Davenport [mailto:[EMAIL PROTECTED]
Sent: 12 September 2008 15:54
To: CF-Talk
Subject: Alternative to using CONTAINS repeatedly?
Hello all,
I'm trying to screen out bad stuff sent to my scripts in the form fields
and I
:54
To: CF-Talk
Subject: Alternative to using CONTAINS repeatedly?
Hello all,
I'm trying to screen out bad stuff sent to my scripts in the form fields
and I know there has to be a better way to do it than this:
cfif lcase(form.First_Name) CONTAINS 'http'
OR lcase(form.First_Name
Couldn't you scale those down by setting a var up top with the script, img etc.
Also set a var so you don't have to repeat the lcase(). Then use a few
listFindNoCase()'s ?
~|
Adobe® ColdFusion® 8 software 8 is the most
6 matches
Mail list logo