Setting up a form on WWW requires two major steps:
If the form is designed for collecting information for human perusal,
then mailmap can be used to send mail to that human
or to a maildrop set up for the purpose. If processing is required,
mailmap outputs a stream of values in a format that
can be easily parsed by standard text manipulation tools.
mailmap. After the config file is set up, you need to
write the form that will refer to it.
mailmap.conf and place it in either
the http configuration directory, or a your home directory.
In mailmap.conf, any line beginning with a #
is a comment, and will be ignored.
Any non-blank line should be of the form
mapname : URL maildrop subjectmapname is the name of the map given in the ACTION for the form.
URL may be either a path on your server, of the form
/path/to/file without the http://server.name
part, or an absolute URL.
maildrop is the address to which to send the mail generated by the form.
An entry with the form
testmap : /user-docs/mailmap.html test Just a test messagecauses any form referring to
testmap to send
mail to the user test with the subject Just a test
message.
FORM tag
To use mailmap, set up a
form with with METHOD="POST" and
ACTION="http://www.phone.net/cgi-bin/mailmap/user/map."
The first part of the URL - cgi-bin - is where script
files live at phone.net. If you are using a different server, you
may need to use a different name here. The second part -
mailmap - is the name of the imagemap program. This will
not change unless you change servers.
If the config file is in your home directory, as
this one is, the next part of the URL is your user name on that
server, so that mailmap can find the config file. If the config file
is in the HTTPD config directory, use
http://www.phone.net/cgi-bin/mailmap/map.",
without user.
The rest of the URL is the name of the map to be found in the config file.
INPUT tagsINPUT tag has a NAME associated with
it. This is what you or your program uses to differentiate the
inputs. In the mail, each NAME is listed as it occurs.
The format is a newline, a :, the number of lines of data
for this NAME, the NAME still url-encoded,
the data, and a blank line.
For example, the HTML tag <INPUT NAME="phone">
which allows the user to enter a single line would result in the mail
having an element of the form:
:1 phone whatever the user typed
ACTION="/cgi-bin/post-query".
This returns a list of NAME and VALUE
pairs for each INPUT tag that has a value.
Here's a moderately complex form, using the post-query
ntest as above. First, the source:
<FORM ACTION="/cgi-bin/post-query" METHOD="POST"> <H3>Godzilla's Pizza -- Internet Delivery Service</H3> Type in your street address: <INPUT NAME="address"><P> Type in your phone number: <INPUT NAME="phone"><P> Which toppings would you like?<P> <OL> <LI><INPUT TYPE="checkbox" NAME="pepperoni" VALUE="topping"> Pepper oni. <LI><INPUT TYPE="checkbox" NAME="sausage" VALUE="topping"> Sausage. <LI><INPUT TYPE="checkbox" NAME="anchovies" VALUE="topping"> Anchov ies. </OL> To order your pizza, press this button: <INPUT TYPE=submit VALUE="Order Pizza">.<P> </FORM>
Changing the action to ACTION=/cgi-bin/mailmap/admin/nullmap
Please send us any comments you may have. If your client does not support forms, send mail to admin@contessa.phone.net