1.写好html和php代码之后,在网页上运行,在输入框输入用户名和密码,在php中可以通过$_GET获取到前端通过get请求提交的数据
2.可以通过form标签的method属性指定发送请求的类型
3.如果是get请求会将提交的数据拼接到URL后面
?userName=ssxzx&Pwd=1314
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<form action="get.php" method="get">
<!--会将下面这些数据以get方式提交到get.php的远程服务器中 -->
<input type="text" name="userName"><br>
<input type="password" name="userPwd"><br>
<input type="submit" value="提交"><br>
</form>
</body>
</html>
<?php
print_r($_GET);//在php中可以通过$_GET获取到前端通过get请求提交的数据
f12进入network可以看到发送请求
点击,显示结果