Skip to main content

Search

Navigation

Sponsor: DHTML Utopia

Article

POST vs. GET

Published on the 30th of January 2005

By Matt Oakes

Skip to the Table of Contents

There are two methods of passing data using forms on the internet. POST and GET. You set the form to use the different method by using this code for POST:

XHTML
<form action="url" method="POST">

And this code for GET:

XHTML
<form action="url" method="GET">

If you don't have the method="" part in the code the web browser will just use the GET method.

You are probably asking now what the difference between the two methods are. Here are the difference between them:

GET

The GET method uses the page url to send the data through. The URL of this page has the same format as the one the get method will output.

Pros:

  • Is very fast.

Cons:

  • Data like passwords are not secure as they can be seen in the url of that page.
  • Only a small amount of data can be sent (255 but that includes the actual url as well).

POST

The POST method sends the data to the next page by making a file with the data in and then the next page picks up and reads the data in the file.

Pros:

  • Very secure.
  • Unlimeted data can be sent.

Cons:

  • Slower then the GET method but still fast.

Conclusion

Both methods are just as easy to use as they both automatically put the data into variables that have the same name as the form object names. Most people use the POST method though because it can send lots of data in one go so you forms will always work. The GET method is still okay to use though.

Sponsor: Songbird Media Player

Applications

Categories

Use Opera

Opera 9. Innovation delivered. Download Now (external link)

Author Profile

Matt Oakes

Matt is a member of the Lowter staff, assisting in content publishing and product management. He resides in England, spending his time writing, programming, and gaming. He also records a podcast with his friend when he's not programming.

All Articles by Matt

Table of Contents

  1. POST and GET
    1. GET
    2. POST
    3. Conclusion

Additional Navigation

Copyright © 2004-2008 Lowter

Sponsor Links