登录页面(login.html):

<!DOCTYPE html>
<html>
<head>
<title>登录页面</title>
</head>
<body>
<h2>登录</h2>
<form action="login_process.php" method="post">
<div>
<label for="username">用户名:</label>
<input type="text" id="username" name="username" required>
</div>
<div>
<label for="password">密码:</label>
<input type="password" id="password" name="password" required>
</div>
<div>
<input type="submit" value="登录">
</div>
</form>
</body>
</html>注册页面(register.html):
<!DOCTYPE html>
<html>
<head>
<title>注册页面</title>
</head>
<body>
<h2>注册</h2>
<form action="register_process.php" method="post">
<div>
<label for="newUsername">用户名:</label>
<input type="text" id="newUsername" name="newUsername" required>
</div>
<div>
<label for="newPassword">密码:</label>
<input type="password" id="newPassword" name="newPassword" required minlength="8"> <!-- 设置密码最小长度 -->
</div>
<!-- 可以添加更多字段如邮箱等 -->
<div>
<input type="submit" value="注册">
</div>
</form>
</body>
</html>在上述代码中,表单的action 属性指向处理登录和注册信息的后端脚本(例如login_process.php 和register_process.php),这些脚本应该包含处理用户输入的逻辑,包括验证用户输入是否有效,存储用户信息等,在实际开发中,你需要根据实际需求来编写这些后端脚本,你也需要在前端添加适当的验证以提高用户体验和安全性。






