亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

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.

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>  get  </title>
</head>
<body>
	<form method="get" action="name.php">
		用戶名:<input type="text" placeholder="請(qǐng)輸入用戶名" name="name"><br>

		密&nbsp;碼:<input type="password" placeholder="請(qǐng)輸入密碼" name="pwd"><br>

		<input type="submit" value="提交"><br>
	</form> 
	
</body>
</html>

Next we create a new name.php file to receive form submissions

<?php

$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

<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>  get  </title>
</head>
<body>
	<form method="post" action="name.php">
		用戶名:<input type="text" placeholder="請(qǐng)輸入用戶名" name="name"><br>

		密&nbsp;碼:<input type="password" placeholder="請(qǐng)輸入密碼" name="pwd"><br>

		<input type="submit" value="提交"><br>
	</form> 
	
</body>
</html>

The post method to receive the code is as follows

<?php

$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

Continuing Learning
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> get </title> </head> <body> <form method="get" action="name.php"> 用戶名:<input type="text" placeholder="請(qǐng)輸入用戶名" name="name"><br> 密 碼:<input type="password" placeholder="請(qǐng)輸入密碼" name="pwd"><br> <input type="submit" value="提交"><br> </form> </body> </html>
submitReset Code