Leilin Peng Share: PHP $ _POST variables

  In PHP predefined variable $ _POST for collecting values ​​from the form method = "post" in.

  $ _POST variable

  Predefined value form is used to collect from the variable $ _POST method = "post" in.

  Information sent with the POST method of form from, for anyone not visible (not displayed in the address bar of the browser), and there is no limit on the amount of information sent.

  NOTE: However, by default, the maximum value of the amount of information transmitted POST method is 8 MB (can be changed by setting php.ini file post_max_size).

  Examples

  form.html document code is as follows:

  

  

  

  

  

  

  

 

  first name:

  age:

  

  

 

  

  

  When the user clicks the "Submit" button, URL similar to the following:

  http://www.codercto.com/welcome.php

  "Welcome.php" file can now be collected by a $ _POST variable form data (Note that the name of the form fields will automatically be the keys in $ _POST array):

  Welcome!

  Your age is years old.

  When to use method = "post"?

  Information transmitted from the form with the POST method of any person who is not visible, and there is no limit on the amount of transmission information.

  However, because the variables are not displayed in the URL, it is not possible to bookmark this page.

  PHP $ _REQUEST variable

  Predefined $ _REQUEST variable contains the $ _GET, $ _ POST and contents of $ _COOKIE.

  $ _REQUEST variable form can be used to collect data transmitted via GET and POST methods.

  Examples

  You can modify the "welcome.php" file for the following code, which can accept $ _GET, $ _ POST and other data.

  Welcome!

  Your age is years old.

  View all PHP tutorial article: https://www.codercto.com/courses/l/5.html (edit: Leilin Peng Source: network intrusion deleted)

Reproduced in: https: //www.cnblogs.com/linpeng1/p/11045849.html

Guess you like

Origin blog.csdn.net/weixin_34255793/article/details/92841487