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.