Zot-Dispatch Variables

The way that an author of a FORM configures Zot-Dispatch to perform in the desired manner is through the use of hidden variables. Hidden variables are input fields in a FORM that are hidden to the user of a FORM. They aren't seen but are present to give extra information to the program handling the FORM (i.e. Zot-Dispatch) or to the recipient of the results from the FORM. A hidden input field is entered into a FORM as follows:
   <INPUT TYPE=hidden NAME="hidden-field-name" VALUE="hidden value">
Zot-Dispatch uses four separate hidden variables to configure its behavior.
ZD-Method

The most important of the Zot-Dispatch Variables is ZD-Method. Zot-Dispatch can perform three basic Actions:

With each FORM that is processed it is possible to perform more than one of these three Actions (For example, an E-mail action and a Reflect action), and it is also possible to perform more than one of the E-mail and Append Actions (For example, two separate E-Mail Actions which e-mail different information to different addresses). Each action is capable of having its own unique output. So what we need for each action we would like to perform is up to three pieces of information. We need to know the action being performed, we need to know what format the response should be for that particular action, and we need to know either e-mail addresses (when the method is E-Mail) or filenames (When the method is Append). ZD-Method is the variable we use to describe the actions we would like to perform. The ZD-Method variable's value is split into three parts:
Dispatch Method
The Method by which to dispatch (e.g. e-mail, reflect, append).
Destination
Where the information is to be sent (e.g. e-mail addresses, filenames).
Response Template
In what form the response should be (e.g. default response, author defined template).
The value(s) of each field of ZD-Method depend(s) on what you would like Zot-Dispatch to do, and what the value(s) of the other fields are.

Dispatch Method

The Dispatch Method field of the ZD-Method variable contains which Action that particular instance of ZD-Method is describing. The valid values are:

ZD-Mail
Response is e-mailed to addresses given directly or indirectly within the value of ZD-Method.
ZD-Reflect
Response is echoed back to the user's client.
ZD-Append
Response is appended to a file named directly or indirectly within the value of ZD-Method.

Destination

The Destination field of the ZD-Method variable contains information about the destination of the results of the FORM, and should contain different types of information based on the value of the Dispatch Method field.

If the Dispatch Method field is set to ZD-Mail then the value of the Destination field should be an e-mail address (or a list of comma-separated addresses) to which the results of the FORM will be e-mailed.

If the Dispatch Method field is set to ZD-Append then the value of the Destination field should be a (single) filename to which the results of the FORM will be appended. Multiple filenames cannot be entered here, even if separated by commas. We will show you how to append to multiple files using the same data at a later time.

Important Note: In order for ZD to append to a file, that file must be writable by the server. Depending on your server setup, this may mean making the file world writable (Probably not a good idea).

If the Dispatch Method field is set to ZD-Reflect then the value of the Destination does not matter. In this case there is only one client to which the results can be echoed, the users. Therefore the value of this field is ignored.

Response Template

The Response Template field of the ZD-Method variable contains information on in which format the response should be. If the author of the FORM wishes the response to be in the default response, then this field should be left empty, however, if the author has a template into which the values of the input fields are to be substituted, the author can do one of two things depending on where the author wishes to store that template.

If the author wishes to put the template directly into the HTML of the FORM, then the value of the Response Template field should be body: followed by the text of the template.

If the author wishes to put the template into a different file which is readable by the HTTP server, then the Response Template should be file: followed by the name of the file which contains the template (the file should be accessible by the server). The three fields of the ZD-Method variable are separated by semi-colons and should be given in the same order listed above as follows:

   <INPUT TYPE=hidden NAME="ZD-Method" 
      VALUE="Dispatch Method;Destination;Response Template"> 

ZD-Environment

The ZD-Environment hidden variable allows the author of a FORM the ability to define environment variables which should be made available to be substituted into a template or placed in the default response. If an environment variable is named in the value of a ZD-Environment variable and that environment variable is defined to the server, then its value will be available to be substituted into a template by using its name for the variable name.

A list of environment variables that are set by the server can be found here.

For example, if you would like to know which host submitted the FORM, then add the following into your FORM:

	<INPUT TYPE=hidden NAME="ZD-Environment" VALUE="REMOTE_HOST">
If your Template is the following:
	The host that submitted the FORM was: $REMOTE_HOST#
Then the result might be (depending on which host submitted the FORM):
	The host that submitted the FORM was: www.oac.uci.edu
There can be as many ZD-Environment variables as there needs to be and each one can be substituted into the Template.
ZD-Date-Format

Zot-Dispatch allows you to define a date format that can be substituted into templates or included in the default response. The format of the date/time string you want is placed in a hidden variable named ZD-Date-Format and uses the same formatting strings as the UNIX "date" command on the server's machine. If ZD-Date-Format is left blank then the "date" command's default output will be used, however, if the hidden ZD-Date-Format variable is not included at all, then the date/time will not be available to enter into the Template.

The Date/Time string can be substituted into a Template by including $ZD-Date# in the Template where you would like the string to appear.

If you have the following Template:

	The date is: $ZD-Date#
And you have ZD-Date-Format set in the FORM as follows:
	<INPUT TYPE=hidden NAME="ZD-Date-Format" VALUE="%B %d, %Y">
The result might be (depending on your version of "date"):
	The date is: November 04, 1994
If more than one variable named ZD-Date-Format is present only the last will be used.
ZD-Owner

The hidden variable ZD-Owner defines an e-mail address to which any errors that might occur while processing your FORM will be sent. If any errors do happen to occur, the address in ZD-Owner will be sent a list of the errors that occurred, and a list of all the name/value pairs that were sent to the server by the client. Some errors that might cause e-mail to be sent to ZD-Owner are:

The actual cause of each error cannot be given, but the data sent to ZD-Owner is meant to help determine the cause of the error.

Multiple addresses can be given in ZD-Owner as long as they are separated by commas. Multiple variables named ZD-Owner can also be given and all addresses will receive a copy of the errors.


LMIII
(Last Revised November 4, 1994)