Yep this is because CGI vars come from the web server, and CF will poll
the server for any Cgi variables it doesn't "know" about. When you dump
the CGI scope you're only seeing ones CF knows should exist, not
necessarily the ones that do.

For instance, on Apache you can access system environment variables
using the CGI scope - CGI.systemroot on windows, for example.

Requesting one that truly doesn't exist will just return an empty
string, as people have noticed :)

~k 

-----Original Message-----
From: Rick Root [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 10, 2006 8:41 AM
To: CF-Talk
Subject: Re: Invalid CGI variables not generating errors

so I guess all those instances where I verify the existence of a CGI
variable are pointless!  I often do this:

<cfif isDefined("CGI.REMOTE_ADDR") AND CGI.REMOTE_ADDR neq "">
  ...
</cfif>

Guess I can change that to

<cfif CGI.REMOTE_ADDR neq "">
   ...
</cfif>

Crazy.

Rick

Nathan Strutz wrote:
> Yes, it's been like this for a long time. #cgi.qwertyuiop# will just 
> return an empty string. Why? I don't know exactly, but I do know it is

> fairly expected, and only works with the CGI scope.
> 
> -nathan strutz
> http://www.dopefly.com/
> 
> 
> On 2/10/06, Rick Root <[EMAIL PROTECTED]> wrote:
> 
>>I was having some issues solving a problem today and eventually I 
>>realized it was because I spelled a CGI variable.
>>
>>On my system (CFMX 7 on Windows), the following does not generate an 
>>exception, as I would think that it should:
>>
>><cfoutput>#CGI.FAHRVERNUGEN#</cfoutput>
>>
>>The behavior is the same on CFMX7 for Linux and Bluedragon 6.2JX on
Linux.
>>
>>Makes me think they planned it that way... but why?
>>
>>Rick
>>
>>
> 
> 
> 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:231951
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