html验证码登录页面代码
时间: 2023-04-02 13:00:44 浏览: 89
以下是一个简单的 HTML 验证码登录页面代码:
```html
<!DOCTYPE html>
<html>
<head>
<title>验证码登录页面</title>
<meta charset="UTF-8">
</head>
<body>
<h1>验证码登录</h1>
<form action="login.php" method="post">
<label for="username">用户名:</label>
<input type="text" id="username" name="username"><br><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password"><br><br>
<label for="captcha">验证码:</label>
<input type="text" id="captcha" name="captcha">
<img src="captcha.php" alt="验证码"><br><br>
<input type="submit" value="登录">
</form>
</body>
</html>
```
其中,`captcha.php` 是生成验证码图片的 PHP 脚本,`login.php` 是处理登录请求的 PHP 脚本。在 `captcha.php` 中,可以使用 GD 库等工具生成随机的验证码图片,并将验证码存储在 session 中,以便在 `login.php` 中进行验证。