源自:6-1 使用表单标签,与用户交互 - 使用<form>创建表单
为什么笔记不可以超过1000个字符呢?
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>form for POST & GET</title>
<meta http-equiv="keyword" content="http://www.diffen.com/difference/GET_(HTTP)_vs_POST_(HTTP)">
</head>
<body>
<h2>POST </h2>
<!-- <form action="form1.php" method="POST" target="_blank" > -->
<form action="form.php" method="post" target="_blank" >
<label for="">username</label>
<input type="text" name="username" placeholder="username" /><br/>
<label for="">password</label>
<input type="password" name="password" placeholder="password" /><br/>
<label for=""> </label>
<input type="reset" value="reset">
<span> </span>
<input type="submit" value="submit">
</form>
<hr/>
<h2>GET </h2>
<form action="form.php" method="GET" target="_blank">
<!-- <form action="xx.xxx" method="get" target="_blank"> -->
<label for="">username</label>
<input type="text" name="username" placeholder="username" /><br/>
<label for="">password</label>
<input type="password" name="password" placeholder="password" /><br/>
<label for=""> </label>
<input type="reset" value="reset">
<span> </span>
<input type="submit" value="submit">
</form>
<hr/>
<!-- error : input without name 属性-->
<!-- <h2>POST </h2>
<form action="form.php" method="post" target="_blank" >
<label for="">username</label>
<input type="text" placeholder="username" /><br/>
<label for="">password</label>
<input type="password" placeholder="password" /><br/>
<label for=""> </label>
<input type="reset" value="reset">
<span> </span>
<input type="submit" value="submit">
</form>
<hr/>
<h2>GET </h2>
<form action="form.php" method="GET" target="_blank">
<label for="">username</label>
<input type="text" placeholder="username" /><br/>
<label for="">password</label>
<input type="password" placeholder="password" /><br/>
<label for=""> </label>
<input type="reset" value="reset">
<span> </span>
<input type="submit" value="submit">
</form> -->
</body>
</html>
<!--
method 不区分大小写!
method="get" method="post" 正确!
method="POST" method="GET" 正确!
-->
<!--
post get error!
input name 属性 不可以少!
-->
提问者:UFO2015
2016-04-16 22:02