![]() |
Note: After the creation "csu-collect.pl" script mentioned below, a new way of using your own cgi-bin program or script has been implemented. You may wish to read about cgiwrap.
So you want to use forms from your lamar or holly account? The first thing you should do then is read something about how forms are created. There are many books and guides on how to create forms and use the Common Gateway Interface. There is also online information defining the HTML used in forms. This includes NCSA's fill-out-form documentation.
Once you have read this you will realize that you need to create a process on your server machine to capture the information your form sends. Normally this is done by creating a cgi-bin capture program(written in any programming language such as C or Perl) for each form that you create and by placing it in the server's cgi-bin directory. This requires that the server's administrator place the process in this directory. For computers that have more than 3000 users per machine such as lamar and holly do, this becomes an unworkable situation as far as the administrators time and ability to review each new user's program and add it to cgi-bin.
To alleviate this situation a general cgi-bin process called "csu-collect.pl" was created to allow any user to collect FORM data to any file the user owns. The form data collected in the user's file can then be further processed by using some method(i.e. via program or script) that the user sets up. The "csu-collect.pl" process requires that Netscape or Lynx is used to send the form. It will also accept Internet Explorer 4.0. Earlier versions may give an error about Netscape or Lynx being required. If you call this script from a virtual host on yuma you should use the full path for the script on www.colostate.edu in the POST below. The full path of this script for www.colostate.edu is http://www.colostate.edu//cgi-bin/csu-collect.pl .
Alternatively, you can use "cgiemail" developed at MIT to email the form data to anyone in a format that you define. To learn about this method go here.
First create your form, for example:
<HEAD> <TITLE>Demo registration form</TITLE> </HEAD> <BODY> <H2>Registration Form Demo</H2> If you are using this form, your browser must be capable of handling fill-in forms. Netscape or Lynx are the only browsers allowed to use this form. <FORM METHOD="POST" ACTION="/cgi-bin/csu-collect.pl"> <HR> <H2>Identification</H2> <PRE> Name:<INPUT TYPE="text" SIZE="55" NAME="Name"> Affiliation:<INPUT TYPE="text" SIZE="55" NAME="Affiliation"> Nationality:<INPUT TYPE="text" SIZE="55" NAME="Nationality"> Name and affiliation on the badge (if different from above): <INPUT TYPE="text" SIZE="55" NAME="Badge"> Street and number:<P> <INPUT TYPE="text" SIZE="55" NAME="Street"> </PRE> <HR> <INPUT TYPE="submit" VALUE=" Send Registration "> </FORM> </BODY>
You can pick up this form and save it by going here. After saving this form to your own directory, modify the first field name or use the "register" name that is there.
As you will notice the FORM METHOD="POST" is used and is required. The ACTION="/cgi-bin/csu-collect.pl" is required. In this example, the first field's name is "register:Name". The "/cgi-bin/csu-collect.pl" process expects the first field name of the form to contain the file name in which the form data will be appended to. The general form of the first name is
NAME="file_name:field_name"
and /cgi-bin/csu-collect.pl uses the part before the : to indicate the file name it writes the form data to, while the part after the : is the first field name. In this example, "register" is the name of the file and "Name" is the name of the first field. The file's name must be a relative path to the URL of the FORM, which means, this file must be in the same directory as the form.
You can also set your ACTION as follows:
<FORM METHOD="POST" ACTION="/cgi-bin/csu-collect.pl?xxx">
Where xxx is the name of the file containing the html you would like displayed after the form is submitted. This file does not have to end in html but it must be in the same directory as your form and readable by the web server.
Again the file specified on the first field MUST BE IN THE SAME DIRECTORY AS THE FORM. To insure that no one else can write to your file except from the form that you create, you must "cd" to the directory containing the file(and the form) and enter the following commands. If the file name is "register" then the commands are:
touch register chgrp-www register chmod g+w register
The "chgrp-www" command allows a user to change the name of the group for file register to "www". This command will do nothing if the user does not own the file. Use the "ls -l" command to verify that the group was changed to "www" and that the group has write permission.