By default if no special program is called when the responses to the form is sent to the mail recipient, the responses will be in one long string. The result is really quite difficult to comprehend.
There are some programs which help to parse the long strings into intelligible areas, and one such program is called formmail.pl It is written by Matt Wright (mattw@worldwidemart.com). This is the one that is installed in the NTU Web server. It is written in Perl Script. NTU uses a modified formmail.pl version 1.6.
The codes that are needed to call this program are some text in the Form action field. Use this POST statement below:
<FORM METHOD="Post" ACTION="http://www3.ntu.edu.sg/cgi-bin/formmail.pl">
There are also three main hidden fields of interest to this program. These are:
| recipient |
email address that will receive the results. It must be a NTU address ending with @ntu.edu.sg |
| subject |
email message subject header |
| redirect |
URL of the 'thank you' page which you have created. This is optional. If you do not use a redirect field, the results of what the user keys in will be displayed on screen once he submits the form. The 'thank you' file is just another ordinary HTML file that you have to create yourself. |
The field names must be in lowercase.
Examples of how you can use the three fields above:
<INPUT TYPE="hidden" NAME="recipient" VALUE="whoever@ntu.edu.sg">
<INPUT TYPE="hidden" NAME="subject" VALUE="XYZ Survey Replies">
<INPUT TYPE="hidden" NAME="redirect" VALUE=http://www3.ntu.edu.sg/directory_name/thankyou.html>
Place the three statements anywhere after the POST statement, and before the SUBMIT button statement.
As for the rest of the form, you can use any of the valid field type you want. There is no limit to the length of field name or any particular way the name of the field ought to be named. Formmail will just take anything in the NAME field wholesale. However, do note that the field names are case-sensitive, i.e. Course is treated as a different field from course. See the sample form given in the next section for illustration.
There are also many other fields with special functions that you can use in your submission form. Read this Formmail Advanced guide for the details.