Adventures in bad variable names

There are many built-in, always-there variable scopes in CF, including #cgi#, #form#, #url#, etc., and one does well to avoid using these names for anything other than their intended purpose. However, I was doing a CFHTTP call (in CF8) and set the result attribute to ‘http’ (the result attribute allows you to specify the return variable name rather than receive the ‘cfhttp’ default) and immediately had issues.

I discovered, to my surprise, that ‘http’ is synonymous with ‘cgi’ – at least under CF8/IIS6. I actually would have expected it to be synonymous with ‘cfhttp’ (I seem to recall that ‘http’; was the fixed return variable name from cfhttp calls in earlier versions of CF?).

Anyway, if I ever need cgi environment variable values I use, of course, #cgi#. I don't ever recall using #http# and never suspected it existed. Begs the question why synonymous scope names even exist.

Anyway, weird.

0 comments… add one

Leave a Comment