HTTP_*
These variables are specific to requests made with HTTP.
Interpretation of these variables may depend on the value of
SERVER_PROTOCOL.
Environment variables with names beginning with "HTTP_" contain
header data read from the client, if the protocol used was HTTP.
The HTTP header name is converted to upper case, has all
occurrences of "-" replaced with "_" and has "HTTP_" prepended to
give the environment variable name. The header data may be
presented as sent by the client, or may be rewritten in ways which
do not change its semantics. If multiple headers with the same
field-name are received then they must be rewritten as a single
header having the same semantics. Similarly, a header that is
received on more than one line must be merged onto a single line.
The server must, if necessary, change the representation of the
data (for example, the character set) to be appropriate for a CGI
environment variable.
The server is not required to create environment variables for all
the headers that it receives. In particular, it may remove any
headers carrying authentication information, such as
"Authorization"; it may remove headers whose value is available to
the script via other variables, such as "Content-Length" and
"Content-Type".
PATH_INFO
A path to be interpreted by the CGI script. It identifies the
resource or sub-resource to be returned by the CGI script. The
syntax and semantics are similar to a decoded HTTP URL `hpath'
token (defined in RFC 1738 [4]), with the exception that a
PATH_INFO of "/" represents a single void path segment. Otherwise,
the leading "/" character is not part of the path.
PATH_INFO = "" | "/" path
path = segment *( "/" segment )
segment = *pchar
pchar = <any CHAR except "/">
INTERNET-DRAFT Common Gateway Interface - 1.1 15 February 1996
The PATH_INFO string is the trailing part of the component
of the script URI that follows the SCRIPT_NAME part of the path.
PATH_TRANSLATED
The OS path to the file that the server would attempt to access
were the client to request the absolute URL containing the path
PATH_INFO. i.e for a request of
protocol "://" SERVER_NAME ":" SERVER_PORT enc-path-info
where `enc-path-info' is a URL-encoded version of PATH_INFO. If
PATH_INFO is NULL then PATH_TRANSLATED is set to NULL.
PATH_TRANSLATED = *CHAR
PATH_TRANSLATED need not be supported by the server. The server
may choose to set PATH_TRANSLATED to NULL for reasons of security,
or because the path would not be interpretable by a CGI script;
such as the object it represented was internal to the server and
not visible in the file-system; or for any other reason.
The algorithm the server uses to derive PATH_TRANSLATED is
obviously implementation defined; CGI scripts which use this
variable may suffer limited portability.
QUERY_STRING
A URL-encoded search string; the part of the script URI.
QUERY_STRING = query-string
query-string = *qchar
qchar = unreserved | escape | reserved
unreserved = alpha | digit | safe | extra
reserved = ";" | "/" | "?" | ":" | "@" | "&" | "="
safe = "$" | "-" | "_" | "." | "+"
extra = "!" | "*" | "'" | "(" | ")" | ","
escape = "%" hex hex
hex = digit | "A" | "B" | "C" | "D" | "E" | "F" | "a"
| "b" | "c" | "d" | "e" | "f"
The URL syntax for a search string is described in RFC 1738 [4].
REMOTE_ADDR
The IP address of the agent sending the request to the server. Not
necessarily that of the client.
=5= |