Unless this behaviour has changed in MX, an isDefined() performed on cgi
variables will aways respond TRUE even if the variable isn't defined.

I just checked this, and yes, the following always returns 'Exists', even
though the variable doesn't.

<cfif isDefined("cgi.momma_said_knock_you_out")>
        Exists.
<cfelse>
        Doesn't Exist.
</cfif>

you should use len(trim(cgi.my_cgi_variable)) instead.

> -----Original Message-----
> From: Allan Cliff [mailto:[EMAIL PROTECTED]
> Sent: 28 March 2003 09:42
> To: CF - List
> Subject: [ cf-dev ] CGI variables in debugging
> 
> 
> HTTP_X_FORWARDED_FOR and REMOTE_ADDR
> 
> I have asked this before but with no reply.
> When doing IP logging and restricted access to control panels 
> / files etc I ask people to register their IP.
> 
> Now what a person thinks their IP is may not always be the 
> same as REMOTE_ADDR as sometimes proxies are used a nd the 
> REAL IP is in the variable HTTP_X_FORWARDED_FOR.
> 
> Any comments on how anyone has got around this?
> 
> If I say 
> 
> <CFIF IsDefined("HTTP_X_FORWARDED_FOR")><CFSET ClientIP = 
> HTTP_X_FORWARDED_FOR>
> <CFELSE><CFSET ClientIP = REMOTE_ADDR>
> </CFIF>
> 
> do you think there will be any problems?
> 
> Thanks
> 
> Allan
> 
> 


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to