PHP 实现的用户登录和数据表格展示的简单网页-1
2023-11-24 本文已影响0人
方生方死FSFS
第一步、创建登录界面(index.php)。
需要修改的地方
- 需要
./images/夜幕.jpg的图片路径修改成你的图片的实际路径。
或者是用必应每日一图接口https://api.isoyu.com/bing_images.php进行配置。
body {
background-image: url("https://api.isoyu.com/bing_images.php");
background-size: cover;
background-position: center;
}
或者你可以把这段删除,不在当前页面显示背景图片。
body {
background-image: url("./images/夜幕.jpg");
background-size: cover;
background-position: center;
}
- 需要
./images/2316.jpg的图片路径修改成你的图片的实际路径。
或者是用必应每日一图接口https://api.isoyu.com/bing_images.php进行配置。
<img src="https://api.isoyu.com/bing_images.php" alt="图片" width="192" height="108" class="center">
或者你可以把这段删除,不在当前页面显示背景图片。
<img src="./images/2316.jpg" alt="图片" width="192" height="108" class="center">
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<style type="text/css">
.center {
display: block;
margin: 0 auto;
}
body {
background-image: url("./images/夜幕.jpg");
background-size: cover;
background-position: center;
}
h2 {
margin-top: 30px;
font-size: 24px;
text-align: center;
}
form {
margin: 0 auto;
max-width: 400px;
padding: 20px;
box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
background-color: #fff;
border-radius: 10px;
}
label {
display: block;
margin-bottom: 10px;
font-weight: bold;
}
input[type="text"], input[type="password"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
box-sizing: border-box;
font-size: 16px;
margin-bottom: 20px;
}
input[type="submit"] {
background-color: #45aaf2;
color: #fff;
padding: 10px 20px;
border: none;
border-radius: 5px;
font-size: 18px;
cursor: pointer;
transition: all 0.3s ease-in-out;
}
input[type="submit"]:hover {
background-color: #3f8bc1;
}
</style>
<title>登录界面</title>
</head>
<body>
<img src="./images/2316.jpg" alt="图片" width="192" height="108" class="center">
<h2 style="color: red;">登录界面</h2>
<form action="yanzheng.php" method="post">
<label for="name">姓名:</label>
<input type="text" id="name" name="name" required>
<br><br>
<label for="password">密码:</label>
<input type="password" id="password" name="password" required>
<br><br>
<input type="submit" value="提交">
</form>
</body>
</html>