The var command retrieves information about GET or POST variables sent to the script via client request. It treats both GET and POST variables the same, regardless of their origin. Note that there are two additional forms of var: var_qs and var_post. These two restrict the retrieval of information to parameters arriving via the querystring (?foo=bar&bee=bop) or POSTing, respectively.
The upload command is for file upload manipulation. See the relevant Apache Directives to further configure the behavior of this Rivet feature.
Load the headers that come from a client request into the provided array name, or use headers if no name is provided.
Load the array of cookie variables into the specified array name. Uses array cookies by default.
Load the array of environment variables into the specified array name. Uses array ::request::env by default.
As Rivet pages are run in the ::request namespace, it isn't necessary to qualify the array name for most uses - it's ok to access it as env.
If it is only necessary to load one environmental variable, this command may be used to avoid the overhead of loading and storing the entire array.
Include a file without parsing it for processing tags <? and ?>. This is the best way to include an HTML file or any other static content.
Like the Tcl source command, but also parses for Rivet <? and ?> processing tags. Using this command, you can use one .rvt file from another.
The headers command is for setting and parsing HTTP headers.
Create a self referencing URL from a filename. For example:
makeurl /tclp.gif
returns http://[hostname]:[port]/tclp.gif. where hostname and port are the hostname and port of the server in question.
cookie gets or sets a cookie. When you get a cookie, the command returns the value of the cookie, or an empty string if no cookie exists.
Convert an integer-seconds-since-1970 click value to RFC850 format, with the additional requirement that it be GMT only.
Print text with the added ability to pass HTML tags following the string. Example:
html "Test" b i
produces: <b><i>Test</i></b>
Increment a variable varname by num. If the variable doesn't exist, create it instead of returning an error.
An html version of the standard Tcl parray command. Displays the entire contents of an array in a sorted, nicely-formatted way. Mostly used for debugging purposes.
This command flushes the output buffer and stops the Tcl script from sending any more data to the client. A normal Tcl script might use the exit command, but that cannot be used in Rivet without actually exiting the apache child process!
This command is useful for situations where it is necessary to only return HTTP headers and no actual content. For instance, when returning a 304 redirect.
Scans through each character in the specified string looking for special characters, escaping them as needed, mapping special characters to a quoted hexadecimal equivalent, returning the result.
This is useful for quoting strings that are going to be part of a URL.
Scans through each character in the specified string looking for any special (with respect to SGML, and hence HTML) characters from the specified string, and returns the result. For example, the right angle bracket is escaped to the corrected ampersand gt symbol.
Scans through each character in the specified string looking for any shell metacharacters, such as asterisk, less than and greater than, parens, square brackets, curly brackets, angle brackets, dollar signs, backslashes, semicolons, ampersands, vertical bars, etc.
For each metacharacter found, it is quoted in the result by prepending it with a backslash, returning the result.
Scans through each character in the specified string looking for escaped character sequences (characters containing a percent sign and two hexadecimal characters, unescaping them back to their original character values, as needed, also mapping plus signs to spaces, and returning the result.
This is useful for unquoting strings that have been quoted to be part of a URL.