next up previous contents
Next: The INPUT command Up: Forms Previous: Forms

Laying Out Forms

HTML provides a number of commands for telling the client to do something special. The first command is FORM which tells the client that everything between one <FORM> command and the next </FORM> terminator is part of the same form. The form command can take a number of attributes:

ACTION=http://www.host.name/cgi-bin/query

This gives the URL of the script to run when the form is submitted. You must supply an ACTION attribute with the FORM command.

METHOD=GET

This is the default method for submitting a form. The contents of the form will be added to the end of the URL that is sent to the server.
METHOD=POST

The post method causes the information contained in the form to be sent to the server in the body of the request.

ENCTYPE=application/x-www-form-urlencoded

This specifies how the information the user typed into the form should be encoded. Currently only the default, application/x-www-form-urlencoded'', is allowed.

If your server supports the POST method, it is advisable to use it, as if you use the GET method, it's possible that long forms will be truncated when they're passed from the server to the script.





Jon Crowcroft
Wed May 10 11:46:29 BST 1995