
批改狀態(tài):未批改
老師批語:
<!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>
<style>
.regLabel {
width: 4em;
text-align: justify;
text-align-last: justify;
}
</style>
</head>
<script src="checkPassword.js"></script>
<body>
<form action="register.php" method="post" class="formregister">
<!-- fieldset>legend{用戶注冊}+.register.username>label[for="uname"]{用戶名}+input:text[name="uname"]^.psw>label[for="password"]{密碼}+input:password[name="password"]^.psw>label{確認(rèn)密碼}+input:password^.department>label{部門}+select^.email>label{郵箱}+input:email^.phone>label{手機(jī)}+input:number -->
<fieldset style="display: inline-grid; gap: 1em">
<legend>用戶注冊</legend>
<div class="register username">
<label for="uname">用戶名</label>
<input
type="text"
name="uname"
id="uname"
placeholder="用戶名不少于6位"
required
autofocus
/>
</div>
<div class="psw">
<label for="password">密碼</label>
<input
type="password"
name="password"
id="password"
required
placeholder="密碼不能少于8位"
/>
</div>
<div class="psw">
<label for="passwordConfirm">確認(rèn)密碼</label>
<input
type="password"
name="password"
id="passwordConfirm"
required
placeholder="請再輸一遍密碼"
onblur="checkPassword(document.getElementById('password').value,this.value)"
/>
</div>
<div class="department">
<label for="department">部門</label>
<select name="department" id="department" required>
<option value="" selected disabled>請選擇</option>
<!-- option[value="$"]{財務(wù)}*6 -->
<option value="1">普通用戶</option>
<option value="2">采購</option>
<option value="3">銷售</option>
<option value="4">財務(wù)</option>
<option value="5">管理員</option>
<option value="6">超級管理員</option>
</select>
</div>
<div class="email">
<label for="email">郵箱</label>
<input
type="email"
name="email"
id="email"
required
placeholder="username@email.com"
/>
</div>
<div class="phone">
<label for="phone">手機(jī)</label>
<input
type="tel"
pattern="[0-9]{11}"
name="phone"
id="phone"
required
placeholder="請輸入11位手機(jī)號碼"
/>
</div>
<!-- .gender>label{性別}+input:radio[name="gender" id="male" value="1" checked]+label{男}+input:radio[name="gender" id="female" value="0"]+label{女} -->
<div class="gender">
<label for="male">性別</label>
<input
type="radio"
name="gender"
id="male"
value="1"
checked="checked"
/>
<label for="">男</label>
<input type="radio" name="gender" id="female" value="0" />
<label for="">女</label>
</div>
<div class="birthday">
<label for="birthday">生日</label>
<input
type="date"
name="birthday"
id="birthday"
value="2000-01-01"
min="1950-01-01"
required
/>
</div>
<!-- .field>label{負(fù)責(zé)客戶}+input:checkbox[name="customer" checked]+label{客戶1}+input:checkbox[name="customer"]+label{客戶2}+input:checkbox[name="customer"]+label{客戶3} -->
<div class="field">
<label for="field1">負(fù)責(zé)客戶</label>
<input
type="checkbox"
name="customer[]"
id="field1"
checked="checked"
/>
<label for="field1">客戶1</label>
<input type="checkbox" name="customer[]" id="field2" />
<label for="field2">客戶2</label>
<input type="checkbox" name="customer[]" id="field3" />
<label for="field3">客戶3</label>
</div>
<!-- .button>input:button[value="注冊"] -->
<div class="button">
<input class="register button" type="submit" value="注冊" />
</div>
</fieldset>
</form>
</body>
</html>
.
連接每一個,第一個前面也有.
name[]
selected disabled
來禁用且讓用戶要選擇一項客戶1、客戶2
或者客戶1、客戶3
傳給后臺的數(shù)組似乎是一樣的,都是 array(2) { [0]=> string(2) “on” [1]=> string(2) “on” },這樣就不知道如何區(qū)分了?微信掃碼
關(guān)注PHP中文網(wǎng)服務(wù)號
QQ掃碼
加入技術(shù)交流群
Copyright 2014-2025 http://ipnx.cn/ All Rights Reserved | php.cn | 湘ICP備2023035733號