Forms Processing on the Web

Forms and forms processing is a very powerful vehicle on the Web. It allows information gathering and processing to proceed on separate machines, completely transparent to the user. It is a good way to begin distributed computing.

Linking the form to the form server

< 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.

There is limited access to the area where accessible scripts and programs can be stored. A useful tool in developing and testing your scripts is
found at 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

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">

Since this will produce the output of your form exactly as it would go to your server program, you can use that file as input in testing your code.
 


The form server

The script that produces the file and a return message to view at your browser is /csc/a/gopherg/cgi-bin/gentest. Gentest creates file /tmp/testscript
[ 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 20 January 1996