The reason these variables are called pseudo-environment variables is because the AS/400 doesn't have Unix-style process environment variables. Instead, Web Server/400 simulates this environment and provides an API to access the variable from scripts.
Listed below are all the environment variables set prior to calling a script. Any of these can be accessed by making an API call with the name of the environment variable passed in as one of the parameters.
auth_data. The auth_type is the same as the AUTH_TYPE environment variable. The auth_data is the authorization type specific data.
/cgi-bin/cgitest/extra/pathwas entered, PATH_INFO would be set to
/extra/path. This value is also completely unescaped as well. This does not include the query string.
/cgi-bin/cgitest/samples/is entered, the Default Source Type is *Root, and the Document Root is
/WWWServ/WebDocs/, then the PATH_TRANSLATED would be set to
/cgi-bin/cgitest/~WWWUSER/is entered, PATH_TRANSLATED would be
/WWWServ/WWWUser/PubHTML/(assuming WWWUSER's home directory is
The QUERY_STRING is everything entered after a question mark ("?") in the URL. This data is not converted at all. The leading question mark is not included. For example, if the user enters a URL of
/cgi-bin/cgitest?this+is+a+query+string, QUERY_STRING would be set to
This is the IP address of the browser in dotted decimal notation. This is always available. For instance, this might be
This is the host name of the browser making the request. If this cannot be obtained, it is not set. For example, this might be
This is the user name used to authenticate requests to the server. This is set to the user portion of the Authenticate request header. If this header is not sent, this variable is not set.
This is a hashed version of the password used to authenticate requests to the server. The password portion of the Authenticate request header is hashed using the MD5(*) algorithm. This algorithm creates a message digest of the password. The vital property of this function is that it is very difficult to obtain the original value (the password) if you only know the message digest. This means the REMOTE_PASSWORD_MD5 value does not have to be protected to maintain the integrity of a user's password. If Authenticate the header is not sent, this variable is not set.
(*)Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm.
This is the HTTP method of the URL request made by the browser. Some valid methods are
This is the name of the currently running script, as it is known by browsers. The name is escaped and does not include any of the PATH_INFO or query strings. For example, the script
/cgi-bin/cgitest/extra/pathwould have a SCRIPT_NAME of
The SERVER_PROTOCOL is the version of HTTP that is being used for this request. This can be either HTTP/0.9 or HTTP/1.0. HTTP/0.9 is only used if the browser has indicated to use that version.
Other Request Headers All other request headers that are sent by the browser are made available to the script through environment variables. Each header has a prefix of HTTP_ added to the header name. Any dashes ("-") in the header name are changed to underscores ("_"). If the same header appears more than once, a comma separated list of each of the header's values is created. For example, the header
User-Agent: NeatBrowser/1.0would result in an environment variable of
HTTP_USER_AGENTwith a value of
NeatBrowser/1.0. Another example is receiving the headers
Accept: text/plain. This would result in one environment variable named
HTTP_ACCEPTwith a value of
The additional scripts sample page shows examples of retrieving environment variables from different programming languages.