Testing for CGI variables

Because some browsers do not support some CGI variables, ColdFusion always returns true when it tests for the existence of a CGI variable, regardless of whether the browser supports the variable. To determine if a CGI server exists, test for the availability, as the following example shows:

<cfscript>
       myServer=cgi.SERVER_NAME;
       if (myServer==cgi.SERVER_NAME)
             WriteOutput("Server exists");
       else
             WriteOutput("Server does not exist");
</cfscript>

To display all CGI variables, use the following code.

<cfscript>
    WriteDump(cgi);
</cfscript>

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online