next up previous contents
Next: Doing Something with Up: Forms Previous: An Example Form

Submitting Forms to the Server

As we mentioned above, there are two ways you can submit a form to a server - the GET method and the POST method. These methods refer to the type of request the browser makes to the client.

GET is the normal way a browser requests a page or an image from a server - the URL gives the location of the file we way or the name of the script that will produce the data we want. We saw with imagemaps that we could also send a small amount of additional data to a script in the URL by putting it at the end of the URL after a question mark. You can also send all the information contained in your form to the server in the same way. However, it's possible that some servers may have size limits in the amount of data they can pass to the script in this way.

POST is an entirely different method from those we've seen so far. A POST request consists of a URL which refers to the script we wish to run, and then a URL encodedgif body which contains the data from our form.

If your server supports the POST method, it is recommended to use it - using the GET method may work, but if your forms are large, it is really stretching the intended purpose of GET somewhat.

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