$_GET, $_POST and $_REQUEST in PHP

$_GET :-

  • Information sent from a form with the GET method is visible to everyone (all variable names and values are displayed in the URL).
  • $_GET also has limits on the amount of information to send. The limitation is about 2000 characters.
  • However, because the variables are displayed in the URL, it is possible to bookmark the page. This can be useful in some cases.
  • $_GET may be used for sending non-sensitive data.

$_POST :-

  • Information sent from a form with the POST method is invisible to other and has no limits on the amount of information to send.
  • Moreover, $_POST support advanced functionality such as support for multipart binary input while uploading files to server.
  • However, because the variables are not displayed in the URL, it is not possible to bookmark the page.

$_REQUEST :-

  • $_REQUEST contains the contents of $_GET,$_POST and $_COOKIE.
Spread the love

Related Post

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *