ice78991
Programmer
- Nov 20, 2006
- 216
I have read that Coldfusion 8 is super fast at dealing with cfparam ( I think Ben Forta recorded it at 300 times faster than Coldfusion 7 )
In the light of this what is the best way to do data validation
At the moment I define each variable with a cfparam
<cfparam name="url.somevar" default="">
and then I check for its existence with
<cfif len(url.somevar) gt 0>
....validate
</cfif>
Is this a good approach or would it be better to use structKeyExists(..) as follows
<cfif structKeyExists(url,"somevar")>
..validate
</cfif>
In the light of this what is the best way to do data validation
At the moment I define each variable with a cfparam
<cfparam name="url.somevar" default="">
and then I check for its existence with
<cfif len(url.somevar) gt 0>
....validate
</cfif>
Is this a good approach or would it be better to use structKeyExists(..) as follows
<cfif structKeyExists(url,"somevar")>
..validate
</cfif>