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>

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License  Twitter™ and Facebook posts are not covered under the terms of Creative Commons.

Legal Notices   |   Online Privacy Policy