Difference between GET and POST methods?

I am new to this forum and I have been learning PHP from this night.

I want to submit a form, but I do not know the difference between:

<form action="page2.php" method="GET">

and

<form action="page2.php" method="POST">

Can anybody help me?

Thank.

+5
source share
4 answers

Get

  • Settings remain in your browser history as they are part of the URL
  • You can add bookmarks.
  • The GET method should not be used when sending passwords or other confidential information.
  • 7607 mark maximum size.
  • Example URL: page2.php? category = sport

Post

  • Settings are not saved in browser history.
  • Unable to create bookmark.
  • The POST method used when sending passwords or other sensitive information.
  • The maximum size is 8 MB for the POST method.
  • Example URL: page2.php
+26
source

HTTP GET , HTTP POST . GET URL-, , . POST . , .

+1

GET, URL- .

www.someemailprovider.com/?login=joe@email.com&password=xxyz

A POST , GET, HTTP-, URL-.

, GET idempotent POST , GET , , POST, , , , GET idempotent, POST - .

, , , GET . GET, , POST. , , , POST , - , .. GET , . , GET , - , .

0

HTTP-, PHP.

$ _ GET is appended to the end or URL. i.e. http://example.org/?foo=bar Get access to it in PHP with:

$foo = $_GET['foo'];

or $ foo = $ _REQUEST ['foo'];

GET is used for information that you do not mind to see people, and can be manually entered in links and URLs to get results.

$ _ POST is not displayed in your URL and is usually used after submitting the form. Access it in PHP with:

$foo = $_POST['foo'];

or $ foo = $ _REQUEST ['foo'];

Learn more about HTTP requests at http://www.w3schools.com/tags/ref_httpmethods.asp

-1
source

All Articles