Home  >  Article  >  Backend Development  >  Detailed explanation of the usage of php9 super global variables (2)_PHP tutorial

Detailed explanation of the usage of php9 super global variables (2)_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:42:161207browse

Today let’s talk about $_GET() and $_POST().

In fact, it is very easy to understand. From the superficial meaning, you can see that it is to obtain the data of the post and get forms. In fact, it is exactly the same. In professional terms,

The $_GET variable is an array containing the variable names and values ​​sent by the HTTP GET method.

The $_GET variable is used to collect values ​​from the form with method="get". Information sent from a form with the GET method is visible to everyone (displayed in the browser's address bar), and there is a limit on the amount of information sent (maximum 100 characters). Okay, let’s look at an example, the code for a simple login interface:

<html>
<center>

</center>
</html>


It will be submitted to the get.php page, and look at its code again:

Welcome <?php echo $_GET["name"]; ?>.<br />
You password is <?php echo $_GET["pwd"]; ?>


Through $_GET["name"], you can get the value named name in the form. The effect is as follows. $_GET() effect.

There is essentially no difference between $_POST and $_GET(), except for the difference between get and post. I won’t go into details here. The code is the same as get. The index page just changes the method’s get to post, and the accepting page changes to $_POST[ 'name'].$_POST effect.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/664283.htmlTechArticleToday, let’s talk about $_GET() and $_POST(). In fact, it is very easy to understand. From the superficial meaning, you can see that it is to obtain the data of the post and get forms. In fact, it is exactly the same. Let’s do something professional...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn