IsHTTP
20 Mar 2010 16:08 UTC 2010079+1608 UTC

Development Page--Not for Official Use

NAME

PDB::IsHTTP() - routine to check if the program is called by HTTP

SYNOPSIS

    if (PDB::IsHTTP()) {  # We are a CGI program
       print "Content-type: text/html\n\n";
       ...
    }

DESCRIPTION

This routine returns 1 if the calling program is an HTTP server and 0 otherwise.

CAVEATS

This routine relies on the environment variable SERVER_PROTOCOL to determine if the calling program is an HTTP server. If the SERVER_PROTOCOL variable is set (e.g., if the calling program is itself a CGI script that did not change SERVER_PROTOCOL) then this function will still return true.

The PDB::ReadForm() routine resets the SERVER_PROTOCOL variable if there are any command-line arguments.

<< IdList | PerlModules | LatLon >>


DNRDocs.SoftwareDocumentation

Page last modified on September 29, 2005, at 09:28 PM