Things to know about ColdFusion


I took a job to program in ColdFusion and to be honest I’ve never coded in ColdFusion before. Though I’m not a one trick pony either, my list of languages is ASP, PHP, Javascript, C, C++, X86 Assembler, MIPS Assembler, and some JAVA. I normally don’t have too much trouble flowing between them but I am the strongest in PHP. That being said here are some tips for ColdFusion.

 

GET and POST vars
Coldfusion is clearly running ontop of JAVA, to access form field vars you use #form.textbox# for POST and #url.idvar# for GET variables. But before you can use those, you need a <cfparam name=”url.idvar” default=””> otherwise it will throw a fit if the variable is not included in GET/POST request.

 

Cleaning User Input – Integers
To clean integers don’t use <cfparam type=”integer” name=”url.id” default=”0″> because if a user enters a letter into the field, then CF will throw a 500 error and abort the page.  Instead don’t give a type and then use <cfset id=Val(url.id)> to recast it to integer.

 

More to come….


I'm a 32 year old UIUC Computer Engineer building mobile apps, websites and hardware integrations with an interest in 3D printing, biotechnology and Arduinos.

View Comments
There are currently no comments.