Whatever message this page gives is out now! Go check it out!

Testing for CGI variables

Last update:
May 18, 2026
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>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page