The form server

The form server is a program, in any language.
It must reside in a directory that has been configured for access to the Web server when it receives data from a form.
Because forms can be accessed and submitted by anyone who can view the form page on the Web, form servers represent a potential security problem for the server system.  Thus, access is generally restricted to programs stored in a directory to which access is strictly limited.  This makes it awkward to test form serving programs if you do not have access to that directory.  To help students on this system, as simple testing scheme is available.

The program gentest produces a file in the /tmp directory and returns a message to the browser from which it was invoked.

Use the test program by specifying
action=http://www.csc.villanova.edu/cgi-bin/cgi-bin/gentest.pl
in your form.
When you submit the form, a generic response will appear on your browser screen and the data sent by your form will appear in the file
/tmp/testscript
on renoir.villanova.edu
You can copy that file to your own directory and test your own program file.
For example, if your program is called serve.pl, and your have copied testscript into the same directory, test your program by typing
serve.pl<testscript
 

Once again, note that the form server program can do anything that any other program can do, given the same permissions.  The program can query and update a database, perform computations or complex logical operations, read and write files, etc.  The only limitation is the access rights.  A program running in the cgi-bin directory generally runs as user = Nobody with no rights to create files (except in /tmp) and no rights to access any other files unless they are open to all users.

The server program can be written in any language.  It must be in an executable form, ready to be invoked by the server when data arrives from a form.
Many form server programs are written in perl.
The perl program that responds to our sample form is gen.pl


[ Villanova Homepage | CSC Homepage | CSC Faculty