> From: S. Isaac Dealey [mailto:[EMAIL PROTECTED] 

> <cfparam name="attributes.objectid" type="numeric" default="0">
> 
> <cfif objectid>... do stuff ...</cfif>
> 
> In my case the attributes scope is a combination of form and 
> url variables... And at a first glance this looks really good 
> because it's nice and validated, you know the data going in 
> is correct. But here's the problem -- if a user happens to be 
> muddling with the url and accidentally types a non-numeric 
> character into that url variable, instead of being ignored 
> the cfparam produces a big ugly cf-error that the user won't 
> want to see... and using val() in the default attribute is no 
> help of course because it's not the default value that's at 
> fault. (and yea, I've made the mistake of type="numeric" default=""
> before too).
> 
> So I'm starting to think that for the base templates or 
> otherwise publicly accessible templates, this structure is better:
> 
> <cfparam name="attributes.objectid" type="string" default="">
> 
> <cfif val(objectid)>... do stuff ...</cfif>
> 
> Although the code is only very subtly different, this 
> structure will never produce the ugly cf error message as a 
> result of a user accidentally malforming the url, because 
> they can't possibly provide a value to the server in the url 
> that CF won't interpret as a string.

Ike,

What about sticking to your original use of cfparam and just having the
appropriate error handling mechanisms in place to deal with someone mucking
with your values?





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:197475
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to