<FORM METHOD="POST" ACTION="/cgi-bin/web-exe">
Form elements and other HTML
</FORM>
There can be several forms in a single document,
but the FORM element can't be nested.
ACTION
specifies the action
URI for the form.
This URI will almost always point to a CGI script
to decode the form results; but it could, for example, be a
mailto.
METHOD
selects an HTTP method
of accessing the action
URI.
There are two methods, GET (the default)
and POST.
Generally speaking, you use GET for only the simplest forms, or
when you want the user to be able to bookmark the query or use
it as a link - it will work just as if the user had filled in
the form as before and submitted it. Use POST for forms with a
lot of fields (GET might not be able to pass all the data) and
for scripts that are supposed to change something on the server
- you normally don't want anyone to do that from a bookmark or link.
METHOD=GET
Information from a form using the GET method is
appended onto the end of the action URI being requested.
Your CGI program will receive the encoded form input in
the environment variable QUERY_STRING.
METHOD=POST This method transmits all form input information immediately after
the requested URI.
Your CGI program will receive the encoded form input on stdin.
The server will NOT send you an EOF on the end of the data,
instead you should use the environment variable
CONTENT_LENGTH to determine how much data you
should read from stdin.
ENCTYPE
specifies the media type used to encode the name/value
pairs for transport, in case the protocol does not itself impose a
format.
With the POST method,
the ENCTYPE attribute is a media type specifying the
format of the posted data
(by default
application/x-www-form-urlencoded).
Rarely used (??).