Getting Started with PHP: $_GET and $_POST
$_GET Variable
The predefined $_GET variable is used to collect values from the form with method="get".
The information sent from a form with the GET method is visible to everyone (will be displayed in the browser's address bar), and there is a limit on the amount of information sent.
get
Next we create a new name.php file to receive form submissions
$name = $_GET['name' ];
$pwd = $_GET['pwd'];
?>
In this way, the content submitted by the form is received, and then we look at the address bar Changes Using the get method will display the content submitted by the form just now in the address bar
Then we use the post method to submit
get
The post method to receive the code is as follows
$name = $_POST['name'];
$pwd = $_POST['pwd'];
?>
Same We also need to use name.php to receive the information submitted by the form. Pay attention to the changes in the address bar. If you use the post method, the address bar will not change and the content of the form will not be displayed.
Note: These two pieces of code require everyone to Create two files yourself and put them on the local server for testing