Skip to main content
April 5, 2016
Question

CGI Variables

  • April 5, 2016
  • 1 reply
  • 1420 views

Hello,
I have recently installed Coldfusion2016, along with it I've configured the apache server which was installed through xampp.
I'm totally newbie to this all.
As in to check if CGI variables I copied the script ColdFusion Help | Testing for CGI variables written here.
It is showing me output as "CGI variable does not exist".
Can anyone help me out? As in Where can I set CGI variables? Am I Missing something?

Thank You.

This topic has been closed for replies.

1 reply

Anit_Kumar
Inspiring
April 5, 2016

Hi Nikhilesh,

Can you share a sample code to repro the behaviour?

Regards,

Anit Kumar

April 6, 2016

Hello Anit,
As I've mentioned earlier I'm totally newbie to CF, I had copied the script form link ColdFusion Help | Testing for CGI variables just to verify the CGI variables which outputs as CGI variable does not exist. Also I replaced <cfif CGI.varname IS NOT "">  to <cfif CGI.SERVER_NAME IS NOT "">.
I'm also trying to set up ColdFusion server along with IIS. Am I making silly mistakes

Thanks.

Anit_Kumar
Inspiring
April 6, 2016

Hi Nikhilesh,

The below code should work for you.

<cfif CGI.SERVER_NAME IS NOT "">

CGI variable exists

<cfelse>

CGI variable does not exist

</cfif>

Just to verify that CGI variables are working, I will suggest an easier way. Please try the below and see the result.

<cfdump var="#cgi#">

Regards,

Anit Kumar