Re: Question about data validation (beginner)
look up the cfswitch cfcase tags, will work much ber than what ur doing. pluas u need to take those or's out and use cfelseif if u gunna do it taht way I have a page which accepts several url variables.I want to make sure if someone manipulated the url in the browser and set the value outside what is handled by the page that this is handled. I was thinking I could check for the existence of the url variable and then if set check for the value not being what I am accepting.If the value is not what I am expecting I take corrective action. I am at a lose to figure out how you handle the 'if it's not what I am expecting ' as opposed to the 'I am expecting this, do that' Below is my failed attempt.Any advice? Thanks, John !--- Catch ChartType values outside the range that are accepted by this page --- cfif IsDefined(URL.ChartType) AND url.ChartType NEQ pie or IsDefined(URL.ChartType) AND url.ChartType NEQ bar or IsDefined(URL.ChartType) AND url.ChartType NEQ line or IsDefined(URL.ChartType) AND url.ChartType NEQ pyramid or IsDefined(URL.ChartType) AND url.ChartType NEQ area or IsDefined(URL.ChartType) AND url.ChartType NEQ cone or IsDefined(URL.ChartType) AND url.ChartType NEQ curve or IsDefined(URL.ChartType) AND url.ChartType NEQ cylinder or IsDefined(URL.ChartType) AND url.ChartType NEQ step or IsDefined(URL.ChartType) AND url.ChartType NEQ scatter cflocation url=""> addtoken=no /cfif !--- End Catch ChartType values outside the range that are accepted by this page --- [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Question about data validation (beginner)
and yes i have been drinking, lol bad spelling day look up the cfswitch cfcase tags, will work much ber than what ur doing. pluas u need to take those or's out and use cfelseif if u gunna do it taht way I have a page which accepts several url variables.I want to make sure if someone manipulated the url in the browser and set the value outside what is handled by the page that this is handled. I was thinking I could check for the existence of the url variable and then if set check for the value not being what I am accepting.If the value is not what I am expecting I take corrective action. I am at a lose to figure out how you handle the 'if it's not what I am expecting ' as opposed to the 'I am expecting this, do that' Below is my failed attempt.Any advice? Thanks, John !--- Catch ChartType values outside the range that are accepted by this page --- cfif IsDefined(URL.ChartType) AND url.ChartType NEQ pie or IsDefined(URL.ChartType) AND url.ChartType NEQ bar or IsDefined(URL.ChartType) AND url.ChartType NEQ line or IsDefined(URL.ChartType) AND url.ChartType NEQ pyramid or IsDefined(URL.ChartType) AND url.ChartType NEQ area or IsDefined(URL.ChartType) AND url.ChartType NEQ cone or IsDefined(URL.ChartType) AND url.ChartType NEQ curve or IsDefined(URL.ChartType) AND url.ChartType NEQ cylinder or IsDefined(URL.ChartType) AND url.ChartType NEQ step or IsDefined(URL.ChartType) AND url.ChartType NEQ scatter cflocation url=""> addtoken=no /cfif !--- End Catch ChartType values outside the range that are accepted by this page --- [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Question about data validation (beginner)
Hi John, So, any of the chart types are acceptable? You can probably just do this: cfif isdefined(url.charttype) AND NOT listfindnocase(pie,bar,line,pyramid,area,cone,curve,cylinder,step,scatter, url.charttype) cflocation url=""> /cfif This assumes that you're only checking the charttype if the url.charttype variable exists. If you want to make sure they both exist, you would do this: cfif NOT isdefined(url.charttype) OR NOT listfindnocase(pie,bar,line,pyramid,area,cone,curve,cylinder,step,scatter, url.charttype) cflocation url=""> /cfif - Original Message - From: John Munyan [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 3:03 PM Subject: Question about data validation (beginner) I have a page which accepts several url variables.I want to make sure if someone manipulated the url in the browser and set the value outside what is handled by the page that this is handled. I was thinking I could check for the existence of the url variable and then if set check for the value not being what I am accepting.If the value is not what I am expecting I take corrective action. I am at a lose to figure out how you handle the 'if it's not what I am expecting ' as opposed to the 'I am expecting this, do that' Below is my failed attempt.Any advice? Thanks, John !--- Catch ChartType values outside the range that are accepted by this page --- cfif IsDefined(URL.ChartType) AND url.ChartType NEQ pie or IsDefined(URL.ChartType) AND url.ChartType NEQ bar or IsDefined(URL.ChartType) AND url.ChartType NEQ line or IsDefined(URL.ChartType) AND url.ChartType NEQ pyramid or IsDefined(URL.ChartType) AND url.ChartType NEQ area or IsDefined(URL.ChartType) AND url.ChartType NEQ cone or IsDefined(URL.ChartType) AND url.ChartType NEQ curve or IsDefined(URL.ChartType) AND url.ChartType NEQ cylinder or IsDefined(URL.ChartType) AND url.ChartType NEQ step or IsDefined(URL.ChartType) AND url.ChartType NEQ scatter cflocation url=""> addtoken=no /cfif !--- End Catch ChartType values outside the range that are accepted by this page --- [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Question about data validation (beginner)
Deanna, On 11/18/2003 at 16:19, you wrote: DS cfif NOT isdefined(url.charttype) OR NOT DS listfindnocase(pie,bar,line,pyramid,area,cone,curve,cylinder,step,scatter, url.charttype) DS cflocation url=""> DS /cfif Or cfif NOT (isdefined(url.charttype) AND listfindnocase(pie,bar,line,pyramid,area,cone,curve,cylinder,step,scatter, url.charttype))cflocation url="" /cfif ~ Ubqtous ~ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Question about data validation (beginner)
Hello. I think you're on the right track.You could make this all smaller like this: cfparam name=url.charttype default=!--- OR OTHER DEFAULT --- cfset validChartTypes=pie,bar,line,pyramid !--- ETC --- cfif not listFindNoCase(validChartTypes,url.charttype cflocation url=""> addtoken=no /cfif -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 1:15 PM To: CF-Talk Subject: Re: Question about data validation (beginner) and yes i have been drinking, lol bad spelling day look up the cfswitch cfcase tags, will work much ber than what ur doing. pluas u need to take those or's out and use cfelseif if u gunna do it taht way I have a page which accepts several url variables.I want to make sure if someone manipulated the url in the browser and set the value outside what is handled by the page that this is handled. I was thinking I could check for the existence of the url variable and then if set check for the value not being what I am accepting.If the value is not what I am expecting I take corrective action. I am at a lose to figure out how you handle the 'if it's not what I am expecting ' as opposed to the 'I am expecting this, do that' Below is my failed attempt.Any advice? Thanks, John !--- Catch ChartType values outside the range that are accepted by this page --- cfif IsDefined(URL.ChartType) AND url.ChartType NEQ pie or IsDefined(URL.ChartType) AND url.ChartType NEQ bar or IsDefined(URL.ChartType) AND url.ChartType NEQ line or IsDefined(URL.ChartType) AND url.ChartType NEQ pyramid or IsDefined(URL.ChartType) AND url.ChartType NEQ area or IsDefined(URL.ChartType) AND url.ChartType NEQ cone or IsDefined(URL.ChartType) AND url.ChartType NEQ curve or IsDefined(URL.ChartType) AND url.ChartType NEQ cylinder or IsDefined(URL.ChartType) AND url.ChartType NEQ step or IsDefined(URL.ChartType) AND url.ChartType NEQ scatter cflocation url=""> addtoken=no /cfif !--- End Catch ChartType values outside the range that are accepted by this page --- [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Question about data validation (beginner)
How about something like this: cfset AcceptableList = pie,bar,line,pyramid,area,cone,curve,cylinder,step,scatter cfif (IsDefined(URL.ChartType)) AND (AcceptableList DOES NOT CONTAIN url.ChartType ) pGet lost you bum!/p cfabort /cfif Chart stuff follows here because you have acceptable values. Cheers, Michael Kear Windsor, NSW, Australia AFP Webworks. -Original Message- From: John Munyan [mailto:[EMAIL PROTECTED] Sent: Wednesday, 19 November 2003 8:03 AM To: CF-Talk Subject: Question about data validation (beginner) I have a page which accepts several url variables.I want to make sure if someone manipulated the url in the browser and set the value outside what is handled by the page that this is handled. I was thinking I could check for the existence of the url variable and then if set check for the value not being what I am accepting.If the value is not what I am expecting I take corrective action. I am at a lose to figure out how you handle the 'if it's not what I am expecting ' as opposed to the 'I am expecting this, do that' Below is my failed attempt.Any advice? Thanks, John http://www.houseoffusion.com/banners/view.cfm?bannerid=34 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Question about data validation (beginner)
Thank you all very much :-)It is working like a champ!!I really appreciate everyone's help! Sincerely, John -Original Message- From: Deanna Schneider [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 1:20 PM To: CF-Talk Subject: Re: Question about data validation (beginner) Hi John, So, any of the chart types are acceptable? You can probably just do this: cfif isdefined(url.charttype) AND NOT listfindnocase(pie,bar,line,pyramid,area,cone,curve,cylinder,step,scatt er, url.charttype) cflocation url=""> /cfif This assumes that you're only checking the charttype if the url.charttype variable exists. If you want to make sure they both exist, you would do this: cfif NOT isdefined(url.charttype) OR NOT listfindnocase(pie,bar,line,pyramid,area,cone,curve,cylinder,step,scatt er, url.charttype) cflocation url=""> /cfif - Original Message - From: John Munyan [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 3:03 PM Subject: Question about data validation (beginner) I have a page which accepts several url variables.I want to make sure if someone manipulated the url in the browser and set the value outside what is handled by the page that this is handled. I was thinking I could check for the existence of the url variable and then if set check for the value not being what I am accepting.If the value is not what I am expecting I take corrective action. I am at a lose to figure out how you handle the 'if it's not what I am expecting ' as opposed to the 'I am expecting this, do that' Below is my failed attempt.Any advice? Thanks, John !--- Catch ChartType values outside the range that are accepted by this page --- cfif IsDefined(URL.ChartType) AND url.ChartType NEQ pie or IsDefined(URL.ChartType) AND url.ChartType NEQ bar or IsDefined(URL.ChartType) AND url.ChartType NEQ line or IsDefined(URL.ChartType) AND url.ChartType NEQ pyramid or IsDefined(URL.ChartType) AND url.ChartType NEQ area or IsDefined(URL.ChartType) AND url.ChartType NEQ cone or IsDefined(URL.ChartType) AND url.ChartType NEQ curve or IsDefined(URL.ChartType) AND url.ChartType NEQ cylinder or IsDefined(URL.ChartType) AND url.ChartType NEQ step or IsDefined(URL.ChartType) AND url.ChartType NEQ scatter cflocation url=""> addtoken=no /cfif !--- End Catch ChartType values outside the range that are accepted by this page --- [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
Re: Question about data validation (beginner)
You wouldn't want to use contains for this. Contains doesn't look for the whole string as a unit, just the piece. If you take your example and set a cfparam name=url.charttype default=ie it'll pass the cfif because pie contains ie. -d - Original Message - From: Mike Kear [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 3:32 PM Subject: RE: Question about data validation (beginner) How about something like this: cfset AcceptableList = pie,bar,line,pyramid,area,cone,curve,cylinder,step,scatter cfif (IsDefined(URL.ChartType)) AND (AcceptableList DOES NOT CONTAIN url.ChartType ) pGet lost you bum!/p cfabort /cfif Chart stuff follows here because you have acceptable values. Cheers, Michael Kear Windsor, NSW, Australia AFP Webworks. -Original Message- From: John Munyan [mailto:[EMAIL PROTECTED] Sent: Wednesday, 19 November 2003 8:03 AM To: CF-Talk Subject: Question about data validation (beginner) I have a page which accepts several url variables.I want to make sure if someone manipulated the url in the browser and set the value outside what is handled by the page that this is handled. I was thinking I could check for the existence of the url variable and then if set check for the value not being what I am accepting.If the value is not what I am expecting I take corrective action. I am at a lose to figure out how you handle the 'if it's not what I am expecting ' as opposed to the 'I am expecting this, do that' Below is my failed attempt.Any advice? Thanks, John http://www.houseoffusion.com/banners/view.cfm?bannerid=34 [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Question about data validation (beginner)
further...add in cfparam name=url.charttype default= at the top and avoid all those IsDefined() calls.cfdefaultcase in the cfswitch can catch when the url var doesn't exist. Doug -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 4:11 PM To: CF-Talk Subject: Re: Question about data validation (beginner) look up the cfswitch cfcase tags, will work much ber than what ur doing. pluas u need to take those or's out and use cfelseif if u gunna do it taht way I have a page which accepts several url variables.I want to make sure if someone manipulated the url in the browser and set the value outside what is handled by the page that this is handled. I was thinking I could check for the existence of the url variable and then if set check for the value not being what I am accepting.If the value is not what I am expecting I take corrective action. I am at a lose to figure out how you handle the 'if it's not what I am expecting ' as opposed to the 'I am expecting this, do that' Below is my failed attempt.Any advice? Thanks, John !--- Catch ChartType values outside the range that are accepted by this page --- cfif IsDefined(URL.ChartType) AND url.ChartType NEQ pie or IsDefined(URL.ChartType) AND url.ChartType NEQ bar or IsDefined(URL.ChartType) AND url.ChartType NEQ line or IsDefined(URL.ChartType) AND url.ChartType NEQ pyramid or IsDefined(URL.ChartType) AND url.ChartType NEQ area or IsDefined(URL.ChartType) AND url.ChartType NEQ cone or IsDefined(URL.ChartType) AND url.ChartType NEQ curve or IsDefined(URL.ChartType) AND url.ChartType NEQ cylinder or IsDefined(URL.ChartType) AND url.ChartType NEQ step or IsDefined(URL.ChartType) AND url.ChartType NEQ scatter cflocation url=""> addtoken=no /cfif !--- End Catch ChartType values outside the range that are accepted by this page --- _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]
RE: Question about data validation (beginner)
doh!me thinks I've been dwinkin two!:| -Original Message- From: Knudsen, Douglas Sent: Tuesday, November 18, 2003 4:18 PM To: CF-Talk Subject: RE: Question about data validation (beginner) further...add in cfparam name=url.charttype default= at the top and avoid all those IsDefined() calls.cfdefaultcase in the cfswitch can catch when the url var doesn't exist. Doug -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 18, 2003 4:11 PM To: CF-Talk Subject: Re: Question about data validation (beginner) look up the cfswitch cfcase tags, will work much ber than what ur doing. pluas u need to take those or's out and use cfelseif if u gunna do it taht way I have a page which accepts several url variables.I want to make sure if someone manipulated the url in the browser and set the value outside what is handled by the page that this is handled. I was thinking I could check for the existence of the url variable and then if set check for the value not being what I am accepting.If the value is not what I am expecting I take corrective action. I am at a lose to figure out how you handle the 'if it's not what I am expecting ' as opposed to the 'I am expecting this, do that' Below is my failed attempt.Any advice? Thanks, John !--- Catch ChartType values outside the range that are accepted by this page --- cfif IsDefined(URL.ChartType) AND url.ChartType NEQ pie or IsDefined(URL.ChartType) AND url.ChartType NEQ bar or IsDefined(URL.ChartType) AND url.ChartType NEQ line or IsDefined(URL.ChartType) AND url.ChartType NEQ pyramid or IsDefined(URL.ChartType) AND url.ChartType NEQ area or IsDefined(URL.ChartType) AND url.ChartType NEQ cone or IsDefined(URL.ChartType) AND url.ChartType NEQ curve or IsDefined(URL.ChartType) AND url.ChartType NEQ cylinder or IsDefined(URL.ChartType) AND url.ChartType NEQ step or IsDefined(URL.ChartType) AND url.ChartType NEQ scatter cflocation url=""> addtoken=no /cfif !--- End Catch ChartType values outside the range that are accepted by this page --- _ _ [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]