Files
JavaWeb/前端Web(HTML+CSS)/12.表单标签.html
2025-10-11 21:43:25 +08:00

32 lines
970 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>表单标签</title>
</head>
<body>
<!-- form表单
get: 提交数据时, 数据会以参数的形式发送给服务器
post: 提交数据时, 数据会以请求体的形式发送给服务器
action: 表单提交时, 数据发送到的服务器地址
method: 默认是get
method: get/post
enctype: 表单提交时, 数据的编码方式
enctype: application/x-www-form-urlencoded
enctype: multipart/form-data
enctype: text/plain
注意:
1. get方法提交的数据, 会显示在地址栏中, 不安全
2. post方法提交的数据, 不会显示在地址栏中, 安全
-->
<form action="/save" method="post">
姓名: <input type="text" name="name"></input>
年龄: <input type="text" name="age"></input>
<input type="submit" value="提交">
</form>
</body>
</html>