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

WBOY
Release: 2016-07-13 10:42:16
Original
1195 people have browsed it

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>
Copy after login


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"]; ?>
Copy after login


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...
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!