Pages

Friday, February 3, 2017

Finding Real IP Address in Coldfusion / by passing proxy server / download server or any proxy server



this code will help to get real ip address through cgi variable in coldfusion

<cfif CGI.HTTP_X_Forwarded_For EQ "">
<cfset real_ipaddress = CGI.REMOTE_ADDR>
<cfelse>
<cfset real_ipaddress = CGI.HTTP_X_Forwarded_For>
</cfif>


Monday, January 30, 2017

pass comma separated values in CFQuery / listqualify single quoted values

select distinct ruleid from MyRulesWITH (NOLOCK)
where
fieldid in (<cfqueryparam value="#arguments.fields#" cfsqltype="cf_sql_varchar" list="true" />)

<cfif variables.scorecardIds neq "">
  and name in (#listqualify(variables.name,"'",",")#)
</cfif>