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 )>
>
> <p>Get 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]
- Question about data validation (beginner) John Munyan
- Re: Question about data validation (beginner) cf
- Re: Question about data validation (beginner) Deanna Schneider
- RE: Question about data validation (beginner) Mike Kear
- RE: Question about data validation (beginner) Deanna Schneider
- RE: Question about data validation (beginner) John Munyan
- RE: Question about data validation (beginner) Douglas.Knudsen
- RE: Question about data validation (beginner) Douglas.Knudsen