iTP Secure WebServer System Administrator's Guide (Version 7.0)

Using Common Gateway Interface (CGI) Programs
iTP Secure WebServer System Administrator’s Guide523346-012
8-21
HTTP Header Variables
HTTP Header Variables
In addition to the predefined environment variables, the iTP Secure WebServer creates
environment variables for HTTP header lines sent by a Web client. The server names
these variables by prefixing HTTP_ to the name of the header converted to uppercase.
Any dash (-) characters in the header name are converted to underscore (_)
characters.
For example, for the Web client header
User-agent: WebBrowser/2.1
the server creates the environment variable HTTP_USER_AGENT and assigns to it
the value
WebBrowser/2.1
Table 8-3. Environment Variable Access Methods
Language Variable Access Method
C/C++ This access method makes a getenv library call
Format:
#include stdlib.h
char *variable = getenv("environment_variable_name")
Example:
char *sname = getenv("SERVER_NAME")
Tcl This access method accesses an environment variable
Format:
$env(environment_variable_name)
Example:
$env(cgi_dump.cgi)
Bourne Shell This access method accesses environment variables as normal shell
variables
Format:
variable=$environment_variable_name
Example:
SNAME = $SERVER_NAME
Korn Shell This access method accesses environment variables as normal shell
variables
Format:
variable=$environment_variable_name
Example:
SNAME = $SERVER_NAME
Java You access environment variables through the HttpServletRequest class