I use CF5

Try this:
1. <CFOUTPUT>#IsDefined("HTTP_REFERER")#</CFOUTPUT><BR>
2. <CFOUTPUT>#IsDefined("HTTP_X_FORWARDED_FOR")#</CFOUTPUT>

1. may give True or False depending if it is the first page you open
2. for most people will give false, depending if you dsl provider uses proxies. I get 
FALSE on Intranet and TRUE on Internet.

Allan
  ----- Original Message ----- 
  From: Rich Wild 
  To: '[EMAIL PROTECTED]' 
  Sent: Friday, March 28, 2003 10:41 AM
  Subject: RE: [ cf-dev ] CGI variables in debugging


  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