University of Virginia Department of
    Computer Science
The information below is for forms submitted with the POST method. There are similarities with the GET method, but POST is considered better for a number of reasons (it is more secure and more data can be passed).

Setting up the program

This department uses cgiwrap to allow people a secure way to have scripts or programs called from their homepages. Basically, rather than have a user directly access your program, you have them access it through cgiwrap, allowing for much greater (though not failsafe) security. For complete information, look at the man page for cgiwrap. For more information about CGI look at the CGI HelpWeb Page.

You should install your program in a directory named cgi-bin located in your public_html directory. Of course you need to make both your directories and the program you want executed as world readable and executable. Note that if your program is a binary executable, it must be compiled on a SunOS 4.x machine, not on a Solaris machine, as the server that executes the script is running SunOS version 4.1.

In the FORM tag, the ACTION parameter's URL should be specified as follows:

http://www.cs.virginia.edu/cgi-bin/cgiwrap?user=userid&script=scriptname
where userid is your login id (such as abc6z) and scriptname is the name of the program you want to execute.

Getting input to the program

When the POST method is used, all the information from the form is encoded and sent as a string of characters to the stdin of the program or script called. The string is of the following form:
name=value&name=value&name=value
where name is the name specified as a parameter in a given input tag and value is equal to value specified or text input depeding upon the input type.

Note that "strange characters" will be escaped in the way that most programmers are familiar with. The characters include "=", "&", and the space. (The instances of "&" and "=" that used to separate names and values are not escaped.)



HelpNet
HelpNet was created by the 1995 incoming graduate class. It is only occasionally updated.
Department of Computer Science
School of Engineering, University of Virginia
151 Engineer's Way, P.O. Box 400740
Charlottesville, Virginia 22904-4740

(434) 982-2200  Fax: (434) 982-2214
Web Comments: webteam@cs.virginia.edu
Admissions Inquiries: inquiry@cs.virginia.edu
Site directory, Other addresses
Server statistics
© Created by the CS Web Team