FormBoss - Forms Processing Script

Introduction:

If you have interactive HTML forms on your website, the FormBoss script can provide you with an efficient and comprehensive way to process your form results. Among the FormBoss script's many features are:

  • All specifications are embedded as 'hidden' fields within the form.
  • You can specify which fields in your form are required.
  • You can specify a next web page to be used on successful form processing or FormBoss can display a default confirmation page.
  • You can specify a web page to be used when errors are encountered or FormBoss can display a default error page with a link back to the form.
  • You can specify any number of recipients who will be e-mailed the contents of the form.
  • You can specify a confirmation message which will be e-mailed to the submitter of the form.
  • You can specify the name of a file which will be used to 'journal' the form results. This file is written as a comma-separated-values (csv) ASCII text file suitable for downloading into your database, spreadsheet, word processor, or as a text file.

Using the FormBoss script:

Using the FormBoss script is easy and straight-forward. These are the steps involved:

  1. In your HTML form definition you specify the method and action parameters as METHOD="POST" and ACTION="/cgi-bin/formboss".
  2. Within the form, you specify a series of parameters which describe how you want FormBoss to handle the form results. These specifications are contained in 'hidden' fields which look something like: <input type="hidden" name="~name~" value="~value~">.
  3. When a visitor to your website form page fills in the form and clicks on the [Submit] button (or otherwise causes the form to be submitted), the form fields are transmitted to the FormBoss script.
  4. FormBoss checks the form results for any required fields you may have specified and responds with an error page for any errors encountered in the form fields.
  5. FormBoss takes the successful form results and processes them in accordance with the instructions you have provided in the 'hidden' field parameters.

Customizing your form to use FormBoss:

First of all, you must specify some values for the overall form using the HTML <Form ...> tag. Within the form declaration, you must use these values:

  • METHOD="POST"

    This tells the client browser to 'post' the form results to the FormBoss script. Omitting this parameter will cause the form fields to be appended to the URL of the FormBoss script. While this is acceptable to FormBoss, it does result in some very long web addresses which are recorded in the server logs and is generally a less efficient and secure way of submitting your form results.
  • ACTION="/cgi-bin/formboss"

    This tells the user's web browser where to send your form results. It must be coded exactly as shown in order for the FormBoss script to receive your form results and process them.

Specifying the FormBoss parameters:

Next you specify the processing options to the FormBoss script as <input type="hidden" ...> fields within your form. These fields are not displayed to the user but are transmitted with the other form fields to the script. The following fields may be specified:

  • <input type="hidden" name="Website" value="~website name~">

    This field tells FormBoss the textual name of your website or form, such as
    "Mary's Home Page" or "Acme Products Order Form". This name is used when sending e-mails and showing confirmations.

  • <input type="hidden" name="NextPage" value="~page name~">

    When a form is processed successfully, this field tells the script where to go or what to do next. You may specify the full or partial URL/address of of another HTML page, such as:
    "thanks.html". If you don't specify this parameter, FormBoss will produce its own confirmation page which tells the form submitter that the form was successfully received.

  • <input type="hidden" name="ErrorPage" value="~page name~">

    This field allows you to specify the URL of a page to be shown when errors (missing fields, etc.) are detected in the form input. If omitted, FormBoss will produce its own error page which features a button that can be clicked to return to the form.

  • <input type="hidden" name="Subject" value="~text~">

    When an e-mail message is to be sent to the list of recipients or to the form submitter, FormBoss uses this field to provide a subject line for that message.

  • <input type="hidden" name="MailTo" value="~list~">

    This field specifies a list of e-mail recipients who are to receive an e-mail with the form's contents. The list consists of valid e-mail addresses (someone@somewhere.com) separated by commas.

  • <input type="hidden" name="Journal" value="~filename~">

    If you specify the Journal field FormBoss will write the fields of the form to a file you specify. Each line of this file will contain the contents of one form submission as a series of quoted, comma-separated fields. Thus, this file is suitable for input to your spreadsheet or database software. If you do not specify an extension for the filename (.xxx), FormBoss uses (.csv). The first field of this line will be the timestamp for when the form was processed.

  • <input type="hidden" name="Fields" value="~field list~" (or value="*" or value="all")>

    This is where you specify what fields in your form you want to be included in the e-mail to recipients or logging to the journal file. Each entry in this list is the name of a field which exists in the form. Field names are separated by commas. These fields will be shown or logged in the order listed. If you specify the value "*" or the value "all", then all of the fields in the form will be processed in the order received from the web browser/client.

  • <input type="hidden" name="Required" value="~field list~">

    Here you may specify the names of fields in the form which are required entries. Each of these fields will be checked for a valid response and the error page is shown when no value exists for a field in this list.

  • <input type="hidden" name="ReplyTo" value="~field name~">

    This field specifies the field name of a field in your form where the form submitter enters a return e-mail address. If specified, it allows FormBoss to use that address as a return e-mail address when sending e-mail to the form recipients.

  • <input type="hidden" name="Confirmation" value="~message~">

    This field is where you specify a confirmation message to be e-mailed to the form submitter. In order to use this field, the ReplyTo field is also required. This confirmation will be e-mailed to the address supplied by the form submitter when a form is successfully processed.
A Complete Example:

Presented here is a complete example of using FormBoss to process your form results. Let's say you have a simple form on your website where you want to collect Names, E-mail addresses and comments from the online visitors.

Such a form might look like this:

Visitor Comment Form
Your Name:
Your E-mail:
Comments:
 

And the HTML code for this form would look like this:

<form method="POST" action="/cgi-bin/formboss">
<input type="hidden" name="Website" value="My Web Site">
<input type="hidden" name="NextPage" value="thanks.html">
<input type="hidden" name="Subject" value="Online Comments">
<input type="hidden" name="MailTo" value="myself@myisp.com">
<input type="hidden" name="Journal" value="comments.txt">
<input type="hidden" name="Fields" value="Name,Email,Comments">
<input type="hidden" name="Required" value="Name,Email">
<input type="hidden" name="ReplyTo" value="Email">
<input type="hidden" name="Confirmation" value="Thanks for your comments.">
...
<input type="text" name="Name" size="40">
...
<input type="text" name="Email" size="40">
...
<textarea rows="3" name="Comments" cols="30"></textarea>
...
</form>

Now, when a visitor fills in this form and clicks on the [Submit...] button, an e-mail will be sent to you by the FormBoss script like that looks like this:

From: My Web Site <jane@somewhere.com>
To: Form Recipient
Subject: Online Comments

Name     : Jane E. Doe
Email    : jane@somewhere.com
Comments : Nice site!

Form received at.: 11/09/2001 6:13:59 am
Website..........: My Web Site (www.mysite.com)
Client...........: 192.168.1.2:1452
Form mailed to...: myself@myisp.com
Confirmation to..: jane@somewhere.com
Journal is at....: http://www.mysite.com/comments.txt
_______________________________________________________
This form was processed successfully by FormBoss, v2.1.

And a confirmation e-mail will be sent to the form submitter that looks like this:

From: My Web Site <myself@myisp.com>
To: Form Submitter
Subject: Online Comments

Thanks for your comments.

About the form you submitted:
-----------------------------

Received by..: My Web Site (www.mysite.com)
Received at..: 11/09/2001 6:13:59 am
_______________________________________________________
This is an automated response from FormBoss, v2.1.

And finally, a line will be logged to a journal file (comments.txt) in your web space directory that looks like this:

"11/09/2001 6:13:59 am","Jane E. Doe","jane@somewhere.com","Nice site!"

You may retrieve the contents of the journal file at any time by clicking on the URL shown in the e-mail sent to you by the FormBoss script.