Environment variables

Before you begin writing your CGI program, you need to understand the format in which the server will pass the data. The server receives the URL-encoded information and, depending on the type of request, passes the information to the CGI program. The server does this by using environment variables, command line arguments, or standard input.

A CGI application program should be able to handle a NULL value when getting an environment variable. For example, when the CGI program is trying to do a getenv(″CONTENT_LENGTH″) and the method is GET, the value would be returned NULL. This is because CONTENT_LENGTH is only defined in method POST (to describe the length of standard input).

The supported environment variables for HTTP Server can be found in the IBM® iSeries™ Information Center. The environment variables have been divided into two groups: Non-SSL and SSL. For more information, see Environment variables on HTTP Server