Text Form CGI

This is the place to find information about the text-form.cgi project. Development on this project was done by University Computing Technologies at the University of Southern Maine.

What's New

  • March 30, 1999/PJG: Added "pipe" to the list of delimiters.
  • October 7, 1998/PJG: Added a link to an ftp help page.
  • October 5, 1998/PJG: Add choice of different delimiters...see below....
  • October 1, 1998/PJG: This page was created and the project has begun.

Introduction

The purpose for this script is to create a tool for storing information submitted by forms on the server without requiring any heavy duty database access or SQL language.

Methodology

It basically works like this....

The page will be a basic form. There will be a text file located in the current directory that is writable by everyone. See Changing File Permissions Using FileZilla for details on how to make your text file writable. When a person submits the form, the info is then added to the end of the text file.

Form

The following is sample html code for a form. We will explain as we go....

The action line of the form will be pretty much the same for everyone, since the script itself is in the cgi-bin directory.

<form action="/cgi-bin/text-form.cgi" method="post">

The following line is where you put the name of the text file that will hold all of the information, in this example the file name happens to be file.txt.

<input type="hidden" name="fileName" value="file.txt">

The following line is optional. If you do not include it, your delimiter will be the default value, "tabs". If you do include it, your choices are "comma", "space", "semi-colon", "colon", "pipe" and finally "tab".

<input type="hidden" name="delimiter" value="tab">

You need to specify how many columns are going to be in the file. In the following example there will be 5 columns.

<input type="hidden" name="columnNumber" value="10">

And finally you need to set up all the input fields for the data. The names of each of these must be the word "item" followed by the column number. In the following example, the data will go into the 4th column.

<input type="text" name="item4">

See the sample page to use a sample form. View the source of this page to get a better idea about how to set a form up if you are still unsure.

Project Parts

text-form.cgi
This is the script that makes all this possible. It is a simple Perl script that takes in parameters as explained in the section above and copies the info to the text file.
Response page
If this page is specified in the hidden field as indicated above, this page will appear instead of the default page when the client submits the form.

Future Fixes

  • Do we want to put delimiters at the ends of lines or not...that is the question....

Any questions, contact Stephen Houser, "houser@usm.maine.edu".