html登录注册页面代码 要求区分商家用户
时间: 2023-12-07 09:03:12 浏览: 38
以下是一个简单的 HTML 登录/注册页面示例,其中包含商家用户和普通用户的区分:
```html
<!DOCTYPE html>
<html>
<head>
<title>Login/Register</title>
</head>
<body>
<h1>Login</h1>
<form action="login.php" method="post">
<label for="username">Username:</label>
<input type="text" name="username" id="username" required><br><br>
<label for="password">Password:</label>
<input type="password" name="password" id="password" required><br><br>
<label for="user-type">User Type:</label>
<select name="user-type" id="user-type">
<option value="customer">Customer</option>
<option value="merchant">Merchant</option>
</select><br><br>
<input type="submit" value="Login">
</form>
<h1>Register</h1>
<form action="register.php" method="post">
<label for="username">Username:</label>
<input type="text" name="username" id="username" required><br><br>
<label for="password">Password:</label>
<input type="password" name="password" id="password" required><br><br>
<label for="confirm-password">Confirm Password:</label>
<input type="password" name="confirm-password" id="confirm-password" required><br><br>
<label for="user-type">User Type:</label>
<select name="user-type" id="user-type">
<option value="customer">Customer</option>
<option value="merchant">Merchant</option>
</select><br><br>
<input type="submit" value="Register">
</form>
</body>
</html>
```
在登录和注册表单中,都有一个 `user-type` 字段,可以选择是 “Customer” 还是 “Merchant” 用户类型。在提交表单时,可以将该字段的值传递到后端,以便在后端进行区分处理。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)