What exactly seperates $POST and $GET. Can some one give me an example of when I would use $_GET as opposed to post because my book is not doing a very good job of explaining that too me.

    $POST is used for values passed by a HTML form with has the method="post" attribute. $GET is used for values passed via a URL query string, which includes values passed by a HTML form using the method="get" attribute.

    As far as whether a given form should use the POST or GET method, the main consideration is whether or not the form processing actually changes anything, such as placing an order, updating a database value, saving values to a text file, etc. In those cases you should use the POST method. In cases where nothing is updated, such as using the inputs to search a database or file and display the results, you should use the GET method. This allows the user to bookmark the resulting URL for future use, among other things. The one exception to this would be if your form needs to transmit a large amount of data as part of the submission, in which case you'll probably need to use the POST method, as there is a limit to how much data can be passed in a URL (the limit varies between various clients and different servers).

    PS: HTML 4.01 Spec. reference on form method

      just to expand on Nog keep this in mind

      when you use the GET method all the data is visible and passed in the address bar
      when you use the POST method all the data is passed behind the scenes and not directly visible

      if u look at the boards url you will see stuff after the page name.. for this thread u see:
      ?p=10784484#post10784484

      which identifies the post number on the board, as mentioned, this is the get method and allows for bookmarking

      in that case you'd use PHP to get that data by going:

      $foo = $_GET['p'];

        Thanks again.

        Sorry for asking so many questions, about stuff I should remember.

          no need to apologize... never stop learning 🙂

          mark the thread resolved if it is indeed so

            Write a Reply...