Skip to main content
2 of 2
added 282 characters in body
Quentin
  • 948.6k
  • 136
  • 1.3k
  • 1.4k

$_POST is populated with data from the body of the HTTP request if that data is formatted using one of the multipart or url-encoded formats.

$_GET is populated with data from the query string portion of the URL.

$_GET will be populated even if the request wasn't a GET request. It only cares if it was in the query string or not.


Since it was brought up in the comments. $_REQUEST contains the data from $_POST and the data from $_GET and the data from $_COOKIES. It's generally best avoided as it makes it possible to be surprised by data coming from places you don't expect.

Quentin
  • 948.6k
  • 136
  • 1.3k
  • 1.4k