Highlighted

CGI Variables

New Here ,
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

919

Likes

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

CGI Variables

New Here ,
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

920

Likes

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
Apr 05, 2016 0
Adobe Employee ,
Apr 05, 2016

Copy link to clipboard

Copied

Hi Nikhilesh,

Can you share a sample code to repro the behaviour?

Regards,

Anit Kumar

Likes

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
Reply
Loading...
Apr 05, 2016 0
New Here ,
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.

Likes

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
Reply
Loading...
Apr 05, 2016 0
Adobe Employee ,
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

Likes

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
Reply
Loading...
Apr 06, 2016 0
Adobe Employee ,
Apr 06, 2016

Copy link to clipboard

Copied

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

Regards,

Anit Kumar

Likes

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
Reply
Loading...
Apr 06, 2016 0
Adobe Community Professional ,
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.

Likes

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
Reply
Loading...
Apr 10, 2016 0
Adobe Employee ,
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

Likes

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
Reply
Loading...
Apr 11, 2016 0
Adobe Community Professional ,
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>

Likes

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
Reply
Loading...
Apr 11, 2016 0
Adobe Employee ,
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

Likes

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
Reply
Loading...
Apr 11, 2016 0
BKBK LATEST
Adobe Community Professional ,
Apr 12, 2016

Copy link to clipboard

Copied

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>

Likes

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
Reply
Loading...
Apr 12, 2016 0