General comments
Formhandler provides the option of collecting some or all of the fields into a comma-delimited datafile stored on the AgServer in your folder area. This feature would be more useful if you are collecing names and addresses of people or doing a survey with checkbox or radio button fields and you might want to tally how many responses each item had. Bringing some types of textual answers into a database or spreadsheet program, especially long text answers, would be less useful in most cases, since it is hard to tally or summarize or reuse long text fields.
You have to create two special new documents to collect data: a document that describes the format of the datafile, and a document (which starts out empty) into which records are recorded by Formhandler.
The data template
The data template itself is an ASCII text document, not an HTML document, and you do not have choices in the layout of this document. An example of the template for the speaker program file I have been using would look like this:
![]()
Notice that quotation marks surround each field, the field name is referenced in the <<xxxx>> double brackets used in other documents used by Formhandler, and there is a comma between each field. There are also no spaces anywhere in this layout. All of the fields must be typed on one long line. At the end of the line, press the Enter key once and then save the document as a TXT file, or more correctly an ASCII text file. The filename can be whatever you want, but it needs to have a .txt extension.
You may notice that in the example above, I have not included all the fields from my sample form. In the form, I collected responses on expertise. Although I set up my email template to send this information to me, I decided that to bring this data into a database or spreadsheet program woould not be helpful to me, so I left off the expertise field in the datafile template.
Also notice that last field is <<log_date>> which is code sent to Formhandler to include from the AgServer's clock the date and time the entry was posted to the form. Sometimes it is useful to know what time people posted a comment or entry. This field is optional and could be put at the beginning of the layout, if you preferred, or you do not even have to use it..
If you create this document in Dreamweaver, you must open a new document, split the screen so you can see the HTML code part, delete ALL HTML tags you can see, and then start typing your datafile template.
If you have the word wrap feature turned on in Dreamweaver, then the line will wrap around on the screen, but you cannot press the Enter key as you are typing this line. You only press the Enter key at the end of the line or record and you press it only one time.
The file for the data
The file for the data itself is an empty file, with nothing in it other than a single hard Return. If created in Dreamweaver, be sure that you have deleted all of the HTML codes in the document.
Referencing the two files in your main form
You need to tell Formhandler about these two files, by adding two hidden input statements in your main form. These hidden fields are placed at the bottom of your form, but inside the form area, where the other hidden statements have been put. Like the hidden input statements used with email output, you cannot change the field name from what is listed here. The value for your field would depend on your filename and its location on the AgServer.
The syntax for referencing the datafile template is:
<INPUT TYPE="hidden" NAME="log_template" VALUE="/usr4/directory&filename-for-template">
A real example for this INPUT line on a form I work with is
<INPUT TYPE="hidden" NAME="log_template" VALUE="/usr4/general/forms/message-datatemplate.txt">
The syntax for referencing the log file is:
<INPUT TYPE="hidden" NAME="log_filename" VALUE="/usr4/directory&filename-for-template">
A real example for this INPUT line on a form I work with is
<INPUT TYPE="hidden" NAME="log_filename" VALUE="/usr4/general/forms/message-datalog.txt">
An example of these two input statements in a form I have created is shown below:

Putting the files on the CALS server
These two files (the datalog template and the empty datafile) along with the revised main form have to be put on the AgServer. You can use the FTP feature in Dreamweaver or use WS_FTP on a Windows machine or Fetch on a Macintosh to put the two new files and the revised form in your folder area.
Setting permissions
Once the two new files and the revised form are on the AgServer, you need to connect to the AgServer and change permissions on the datafile so that Formhandler can write to that file. This act - changing permissions on a file - might be new to you, if you have only used Dreamweaver to put files on a site and you are the only one working on the site.
Because the AgServer is a multi-user system with many people connecting to it at the same time, extra security is needed to ensure that only authorized people are reading and writing files to a web folder area.
When you use Dreamwever or even most copies of WS_FTP to put files on your website, the files are listed as read/write only to the owner (the person posting the file). Although all the other files used with your form can be left as read/write only by the owner of the file, the datafile itself must be changed to be "writable" by the AgServer. So that as data is posted through a form, it is put into the datafile.
You have to use Telnet or some similar email program to connect directly to the AgServer. You cannot use Eudora or Outlook. Once you connect to the AgServer, logging in with your normal logon name and password, you need to use the change directory command and move to where your web form files are stored. In my case, I would type in this command:
cd /usr4/general/forms/ and press Entersince this is where my forms are located. If I then used the dir command, I would see a list of the files and the permissions associated with those files:

The line I have highlighted is the datafile log, and it has a read/write setting only for the owner. I need to change this by typing in a command:
chmod 777 message-datalog.txt and pressing EnterNothing appears to happen.
However, if I enter the command of dir and press the Enter key, I should see that the permissions have changed for the file I named:
Notice that the coding on the left of the datalog file line is
-rwxrwxrwxwhich is the coding to say it is writable by the AgServer or, in this case, Formhandler.
If you leave off this step to change permissions on the log file, you will get an error message when you try to post to the form.
If you have not worked with permissions on the CALS server, I suggest you look at this clip. There is also information about file permissions in this document: cals.arizona.edu/ecat/web/permissions.html.
This document is part of a set of tutorials related to putting a form on your website. The initial page is found at cals.arizona.edu/ecat/forms/olderforms.html