用PHP写出一个漂亮的登录界面
时间: 2023-02-05 14:30:25 浏览: 77
下面是一个使用 PHP 写出一个漂亮的登录界面的示例代码:
```
<!DOCTYPE html>
<html>
<head>
<title>登录界面</title>
<style>
/* 添加一些样式 */
body {
font-family: sans-serif;
background-color: #f1f1f1;
}
.login-form {
width: 300px;
margin: 0 auto;
background-color: white;
border-radius: 5px;
padding: 20px;
}
.login-form h1 {
text-align: center;
margin-bottom: 20px;
}
.login-form .form-control {
width: 100%;
height: 40px;
border: 1px solid #ddd;
border-radius: 5px;
margin-bottom: 20px;
padding: 0 10px;
font-size: 14px;
}
.login-form .btn {
width: 100%;
height: 40px;
border: none;
border-radius: 5px;
background-color: #4caf50;
color: white;
font-size: 14px;
cursor: pointer;
}
</style>
</head>
<body>
<div class="login-form">
<h1>登录</h1>
<form action="login.php" method="post">
<input type="text" name="username" class="form-control" placeholder="用户名">
<input type="password" name="password" class="form-control" placeholder="密码">
<input type="submit" value="登录" class="btn">
</form>
</div>
</body>
</html>
```
这段代码中,我们使用了 HTML 和 CSS 来创建一个简单的登录界面。在这个界面中,用户可以输入用户名和密码,然后点击“登录”按钮进行登录。
注意:这仅仅是一个示例,在实际应用中,你需要进行更多的安全检查和认证,例如验证用户名和密码的有效性,防