Linking the form to the form server

The FORM tag identifies this html document as a form that is connected to a program on the Web server.
The FORM tag defines the way that information from the form will be sent to the program and also identifies the program that will receive the form information as input.

The two methods for sending information from the form to the program are

GET
POST
GET puts the data entered into the form into an environment variable to be used by the program.  Data entered with the method set to GET appears in the URL after a question mark when the form is ready to submit.  Because there are limits to the amount of data that can be entered into an environment variable, the GET method will not work with forms that require long data entry.

POST sends data to the program in the standard input.  There is no limit to the input length.
The format of the FORM tag, using the POST method for sending data follows.

< FORM METHOD = "POST" ACTION = "http://www.csc.villanova.edu/cgi-bin/cgi-bin/form.server.name">
We will only look at METHOD = POST.

ACTION = cgi-bin/cgi-bin/form.server.name
points to the process that will accept input from your form and perform whatever actions you have described.
The process is frequently defined as a script file.

Most systems are set up so that form processing programs can only be stored in particular directories.
This is a security measure because carelessly generated forms programs could represent risks to the system.

To allow students to create and test forms handling programs, as simple tool is available at the following location:

http://www.csc.vill.edu/cgi-bin/cgi-bin/gentest.pl
 This is  a little perl program to aid in testing your form servers.  The file just takes whatever input a form provides and writes it to a file
called /tmp/testscript on Renoir.  You can make any form send its contents to that program and then look at /tmp/testscript to see what data the form sent to the server.  You can then copy that file into your own directory and use it as input to your form processing program for testing purposes.

The downside of this approach is that each of you will write to the same file.  So, you need to submit your form and then immediately copy that file from the /tmp area to your own directory.  If the content looks really strange, it may be that two or more of you are testing at the same time.  Select a random number, count slowly to that number and try again. (Ethernet collision resolution.)
 

To use the test file, use the following in your form:

<form method="post" action="http://www.csc.vill.edu/cgi-bin/cgi-bin/gentest.pl">
[ Villanova Homepage | CSC Homepage | CSC Faculty ]
Lillian N. (Boots) Cassel

Department of Computing Sciences
Villanova University
Villanova, PA 19085-1699
+1 610 519 7341

cassel@vill.edu 1 September 1999