• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CGI Variables

Guest
Apr 05, 2016 Apr 05, 2016

Copy link to clipboard

Copied

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.

Views

1.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 05, 2016 Apr 05, 2016

Copy link to clipboard

Copied

Hi Nikhilesh,

Can you share a sample code to repro the behaviour?

Regards,

Anit Kumar

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 05, 2016 Apr 05, 2016

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 06, 2016 Apr 06, 2016

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 06, 2016 Apr 06, 2016

Copy link to clipboard

Copied

Also, we have updated the document, for more clarity.

Regards,

Anit Kumar

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2016 Apr 10, 2016

Copy link to clipboard

Copied

Anit_Kumar wrote:

Also, we have updated the document, for more clarity.

Hi Anit,

The document has yet to be updated.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 11, 2016 Apr 11, 2016

Copy link to clipboard

Copied

A. Bakia wrote:

Hi Anit,

The document has yet to be updated.

The document was updated last week. Can you check?

Regards,

Anit Kumar

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2016 Apr 11, 2016

Copy link to clipboard

Copied

I checked. The code in the document is:

<cfscript>

       myServer=cgi.SERVER_NAME;

       if (myServer==cgi.SERVER_NAME)

             WriteOutput("Server exists");

       else

             WriteOutput("Server does not exist");

</cfscript>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 11, 2016 Apr 11, 2016

Copy link to clipboard

Copied

That's the updated code. Are you expecting to see, somewhat different code/results?

Regards,

Anit Kumar

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2016 Apr 12, 2016

Copy link to clipboard

Copied

LATEST

Yes, I was expecting different code. For example, your own code:

<cfif CGI.SERVER_NAME IS NOT "">

CGI variable exists

<cfelse>

CGI variable does not exist

</cfif>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation