# 1.输出结果
2.代码部分
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>表单实战之用户注册</title>
</head>
<body>
<h2 >用户注册信息</h2>
<form action="register.php" method="POST" enctype="multipart/form-data" target="_blank" id="register" />
<fieldset>
<!-- ! 注册信息 -->
<legend>注册信息</legend>
<!-- ! 1.用户名 -->
<div class="username">
<label for="myname">用户名:</label>
<input
type="text"
id="myame"
name="username"
value=""
placeholder="请输入您的用户名"
required
/>
</div>
<!-- ! 2.密码 -->
<div class="password">
<label for="paword">密 码:</label>
<input
type="password"
id="paword"
name="password"
value=""
placeholder="请输入您的密码"
required
/>
</div>
<!-- ! 3.email -->
<div class="email">
<label for="myemail">邮 箱:</label>
<input
type="email"
id="myemail"
name="email"
value=""
placeholder="XXXX@163.com"
/>
</div>
<!-- ! 4.博客 -->
<div class="blog">
<label for="myblog">博 客:</label>
<input
type="url"
id="myblog"
name="blog"
value=""
placeholder="http://"
/>
</div>
<!-- ! 5.年龄 -->
<div class="age">
<label for="myage">年 龄:</label>
<input
type="number"
id="myage"
name="age"
value="18"
min="18"
max="80"
step="2"
/>岁
</div>
<!-- ! 6.生日 -->
<div class="birthday">
<label for="mybirthday">生 日:</label>
<input
type="date"
id="mybirthday"
name="birthday"
value="2022-10-19"
min="1940-05-01"
max="2022-10-18"
</div>
<!-- ! 7.性别 -->
<div class="gender">
<label for="secret">性 别:</label>
<input type="radio" name="gender" value="male" id="male"><label for="male">男</label>
<input type="radio" name="gender" value="female" id="female" ><label for="female">女</label>
<input type="radio" name="gender" value="secret" id="secret" checked><label for="secret">保密</label>
</div>
<!-- ! 8.爱好 -->
<div class="hobby">
<label>爱 好:</label>
<input type="checkbox" name="hobby[]" value="music" id="music" checked><label for="music">音乐</label>
<input type="checkbox" name="hobby[]" value="game" id="game"><label for="game">游戏</label>
<input type="checkbox" name="hobby[]" value="trave" id="trave"><label for="trave">旅游</label>
<input type="checkbox" name="hobby[]" value="sleep" id="sleep"><label for="sleep">睡觉</label>
</div>
<!-- ! 9.学历 -->
<div class="edu">
<label for="edu">学 历:</label>
<select name="edu" id="edu" form="">
<option value="" selected disabled>--请选择--</option>
<option value="0">文盲</option>
<optgroup label="义务教育">
<option value="1">小学</option>
<option value="2">初中</option>
<option value="3">高中</option>
</optgroup>
<optgroup label="高等教育">
<option value="4">专科</option>
<option value="5">本科</option>
<option value="6">硕士</option>
<option value="7">博士</option>
</optgroup>
</select>
</div>
<!-- ! 10.头像 -->
<div class="upload" >
<label for="upload">头 像:</label>
<input type="file" name="user_pic" id="upload" />
<button type="button">上传照片</button>
</div>
<!-- ! 11.自我评价 -->
<div>
<label for="comment">自我评价:</label></br>
<textarea name="comment" id="comment" cols="28" rows="4" maxlength="300" style="resize: none" placeholder="请写一个不少于50字的自我评价"></textarea>
</div>
<button type="submit">立即提交</button>
</fieldset>
</form>
</body>
</html>