Using Forms on Art on the Net
Our server supports a simple forms interface that allows for
collecting data entered into the form by the viewer. The data
can be appended to a file in your account directory, and/or
e-mailed to you. The instructions below assume you know
how to write HTML forms. If not, see the
Beginner's Guide to Writing HTML.
To use our forms interface, you must use the POST method of submitting
the form. The action for the POST method will point to a URL that
processes the form data. The URL specifies both a program that processes
the form, and the location of a configuration file that tells it how
to process the form. For example, your HTML form would start with the
In this example, cgibin/form is the name of our forms processing
program. dir is replaced by your directory name without /home/art/WWW,
(ie: /Studios/Visual/Lile) and filename is the name of the configuration
file that will be used by the forms processing program. You can have different
configuration files for each form, or use the same one for multiple forms.
You must create the configuration file and place it in the path specified
by the action URL mentioned above. The configuration file must contain
at least two items (one per line): a
name for the form,
URL that should be returned after the forms processing
is finished. Additionally, it can contain a command to append the
form data into a file, and/or a command to email the form to a
specified address. The configuration file commands are:
- name formname
- return URL
- file filename
- mail address
This file specifies a name for the form (test), a URL to return after
it is processed (thanks.html), and that the form data be appended
to a file (form.data) and also emailed (to email@example.com).
If the URL to return is not fully specified (ie. does not start with
http://hostname/) then "http://www.art.net/yourdirectory/" is
prefixed to the URL.
The form data is formatted into a number of fields: date, time,
hostname accessing the form, name of the form, and then followed
by the form data. The form data is in the format fieldname='data';
multiple fields are separated by semicolons. For example:
19941109 004223 foo.com test name='joe'; number='123'
One last note: In order to have data appended to a file in your
directory, the file must exist and be set world-writeable. The
protection we recommend for a data file is "rw-rw--w-". To
set up a data file, create an empty file and transfer it to your
directory. Then set the protections using the FTP command
quote site chmod 662 filename. We are looking into a
better way to handle this.