Available Rexx Variables

The Mod_Rexx interface constructs some Rexx variables prior to the start of the Rexx program. Others are constructed during a call to an external Rexx function (these are noted in their descriptions). Note that if a variable has no valid value then it is assigned a zero-length string.

The program TEST.REX is a short example of what can be done with the Mod_Rexx interface. All available Rexx variables set by the interface start with 'WWW' and are used in the TEST.REX program.


Rexx VariableContents
WWWARGS.0 This is the number of arguments passed to the Rexx program by a GET or PUT HTTP request.

Note: This variable is only valid after a call to the Rexx external function WWWGetArgs.

WWWARGS.n.!NAME and
WWWARGS.n.!VALUE
This is the list of arguments passed to the Rexx program. If this is a GET request then this is the list of QUERY_STRING name=value pairs in the URI. If this is a POST request then this is the list of POST variable name=value pairs.

In addition, the array is also available through Rexx variable indirection i.e. if WWWARGS.1.!NAME = 'hiddenfield' then WWWARGS.'hiddenfield' = WWWARGS.1.!VALUE. Note that the case of the variable in the HTML document and the case of the Rexx variable stem tail are significant.

Note: This variable stem array is only valid after a call to the Rexx external function WWWGetArgs.

WWWAUTH_TYPE This is the authentication method.
WWWCONTENT_LENGTH This is the length of the data buffer sent by the client.
WWWCONTENT_TYPE This is content type of the passed data.
WWWCOOKIES.0 This is the number of cookies passed to the Rexx program.

Note: This variable is only valid after a call to the Rexx external function WWWGetCookies.

WWWCOOKIES.n.!NAME and
WWWCOOKIES.n.!VALUE
This is the list name=value cookie pairs passed to the Rexx program.

In addition, the array is also available through Rexx variable indirection i.e. if WWWCOOKIES.1.!NAME = 'SESSION_ID' then WWWCOOKIES.'sessionid' = WWWCOOKIES.1.!VALUE. Note that the case of the variable in the cookie and the case of the Rexx variable stem tail are significant.

Note: This variable stem array is only valid after a call to the Rexx external function WWWGetCookies.

WWWDEFAULT_TYPE This is the value of the DefaultType directive or text/plain if not configured.
WWWFILENAME This is the fully qualified path and filename which has been translated from the URI passed to the server.
WWWFNAMETEMPLATE This is the temporary filename template that will be passed to Mod_Rexx. It specifies the fully qualified path and filename template for producing a temporary Rexx file at a specified location. Apache needs to have write access to the specified file and directory.

The format and rules for the template are the same as for the Rexx external function SysTempFileName(). See the Rexx Reference manual for more information.

WWWGATEWAY_INTERGACE This is the name and version of the gateway interface.
WWWHOSTNAME This is the hostname in the URI.
WWWHTTP_USER_ACCEPT This is a list of the Mime types the browser client will accept.
WWWHTTP_USER_AGENT This is the browser type and version used by the client.
WWWIS_MAIN_REQUEST 1 if this is an initial request or for requests triggered by internal redirects, 0 for subrequests.
Note: Because of a limitation imposed in the Mod_Rexx package, the value of this variable will always be 1.
WWWPATH_INFO This is the filename of the script.
WWWPATH_TRANSLATED This is the fully qualified path and filename of the script.
WWWPOST_STRING If the WWWREQUESTTYPE is "POST" then this is the unparsed name/value pairs read from the browser. Otherwise this variable is a zero-length string.

Note: This variable is only valid after a call to the Rexx external function WWWGetArgs.

WWWQUERY_STRING If the WWWREQUESTTYPE is "GET" then this is the unparsed QUERY_STRING portion of the URI. Otherwise this variable is a zero-length string.
WWWREMOTE_ADDR This is the TCP/IP address of the requesting host.
WWWREMOTE_HOST This is the DNS name of the requesting host (if available).
WWWREMOTE_IDENT This is the remote user name.
WWWREMOTE_USER This is the authenticated username.
WWWREQUEST_METHOD This is the request method, usually either "GET" or "POST".
WWWRSPCOMPILER This is the name of the Rexx RSP compiler program.
WWWSCRIPT_NAME This is the fully qualified URI path and name of the script. If an RSP file was requested this is the fully qualified URI path and name of the RSP file.
WWWSERVER_NAME This is the host name of the server.
WWWSERVER_ROOT This is the HTTP server's root path.
WWWSERVER_PORT This is the server's port number.
WWWSERVER_PROTOCOL This is the request HTTP protocol version.
WWWSERVER_SOFTWARE This is the name and version of the WWW server software.
WWWUNPARSEDURI This is the unparsed portion of the request URI.
WWWURI This is the entire request URI.

In addition, you can create additional initialized Rexx variables by using the RexxSetVar directive in the httpd.conf file.

You can include as many RexxSetVar directives as you need. They will all be initialized prior to the start of the Rexx script. Additional information can be found in the RexxSetVar directive documentation.


Valid XHTML 1.0! Copyright (C) W. David Ashley 2004. All Rights Reserved.