博客列表 >get/post方式

get/post方式

电动机的博客
电动机的博客原创
2019年04月21日 20:57:41833浏览

<html>
<head>
   <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
   <title>get</title>
</head>
<body>
   <form action="" method="get">
       <label for="email">邮箱</label>
       <input type="email" id="email" name="email" value="">
       <label for="password">密码</label>
       <input type="password" id="email" name="password" value="">
       <button>登陆</button>
   </form>
</body>
</html>



<html>
<head>
   <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
   <title>post</title>
</head>
<body>
<h2>用户登陆</h2>
<form action="" method="post">
   <p>
       <label for="email">邮箱</label>
       <input type="email" id="email" name="email" value="<?=$_POST['email']?:''?>">
   </p>
   <p>
       <label for="password">密码</label>
       <input type="password" id="email" name="password" value="<?=$_POST['password']?:''?>">
   </p>
   <p>
       <button>登陆</button>
   </p>

</form>
</body>
</html>

<?php
echo '<pre>';
print_r($_POST);
?>

声明:本文内容转载自脚本之家,由网友自发贡献,版权归原作者所有,如您发现涉嫌抄袭侵权,请联系admin@php.cn 核实处理。
全部评论
文明上网理性发言,请遵守新闻评论服务协议