Form Processing

Forms are processed when an input button is pressed within the form.

The processing of the form is specified by the ACTION parameter in the <FORM> tag.

  <FORM METHOD=method ACTION=action>
    inputs
  </FORM>

The url should be an executable program. you should place this binary in whatever you've defined as your cgi-bin directory (see the ScriptAlias entry in your srm.cnf file in the httpd configuraion).

METHOD can be one of the following:

  1. POST
  2. GET

Examples:


GET

This method has been withdrawn. See documentation on obsolete features for information on the GET method.

POST

When the submit button is pressed, the FORM details are written out into a file and the ACTION URL is called.

The ACTION url should be a name of a backend program which parses the file and writes the contents to he output-file.

The names of the this file and the file the program is allowed to write new html into are passed to the program as environment variables.

output_file
This is the file that Mosaic reads after the command in the ACTION url has finished.

CONTENT_FILE
the file containing the formatted form contents. The same formatting as in the GET method:
field1=field1 contents&field2=field2 contents&...&fieldn=fieldn contents&
Its possible that the representation of a line-feed is different under Xmosaic.


Example of a perl script

From: Eric Hall hallway@umcc.umich.edu
Once a form has been filled in, and the "Submit" button pressed, Mosaic sends the information as concatinated strings to the server. The server can then process the strings as STDIN. Here is an example of a form:
Name.....
Address..
Phone....

suppose that the user typed the following into the fields
Name
this is one field
address
this is the next field
phone
this is the third field
The string sent to the action URL by the server would be:
name=This+is+one+field address=This+is+the+next+field phone=This+is+the+third+field
When the server replies, the VERY FIRST line it must send is:
 Content-type: text/html\n\n
The 2 return characters.. are VERY important.

Examples