PHP_GET数据获取(以登录表单为例)

index.html页面的实现

<!DOCTYPE html>
<html>
<head>
	<title>登录</title>
	<meta charset="utf-8">
</head>
<body>
<form action="index.php" method="get" >
姓名:<input type="text" name="name"><br/>
密码:<input type="password" name="pass"><br/>
<input type="submit" >
</form>
</html>

在这里插入图片描述

index.php页面实现

具体用到了 PHP_GET方法

<?php
header('content-type: text/html; charset=utf-8');
  echo '欢迎用户 :'.$_GET['name'];
  echo '<br/>' ;
  $s= $_GET['pass'];
  echo '密码'. $s;
?>

在这里插入图片描述

发布了62 篇原创文章 · 获赞 102 · 访问量 3142

猜你喜欢

转载自blog.csdn.net/weixin_44763595/article/details/104965272