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.
Copy link to clipboard
Copied
Hi Nikhilesh,
Can you share a sample code to repro the behaviour?
Regards,
Anit Kumar
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.
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
Copy link to clipboard
Copied
Also, we have updated the document, for more clarity.
Regards,
Anit Kumar
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.
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
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>
Copy link to clipboard
Copied
That's the updated code. Are you expecting to see, somewhat different code/results?
Regards,
Anit Kumar
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>