src/image.png

单独生成在一个文件夹里
This commit is contained in:
jiangsir 2024-09-12 19:15:15 +08:00
parent a1c1ee03ec
commit 0c6cb39003
5 changed files with 254 additions and 0 deletions

25
src/_config.php Normal file
View File

@ -0,0 +1,25 @@
<?php
error_reporting(E_ALL ^ E_DEPRECATED);
$db['host'] = '127.0.0.1';
$db['port'] = '3306';
$db['username'] = 'haxo';
$db['password'] = 'haxo';
$db['database'] = 'students';
// 创建 MySQLi 连接
$link = new mysqli($db['host'], $db['username'], $db['password'], $db['database']);
// 检查连接是否成功
if ($link->connect_error) {
die('Could not connect: ' . $link->connect_error);
}
// 设置字符集
$link->set_charset('utf8');
foreach ($_POST as $key => $value) {
if (stripos($value, 'sleep') !== false || stripos($value, 'benchmark') !== false) {
die('BAN sleep,benchmark');
}
}
?>

13
src/db.sql Normal file
View File

@ -0,0 +1,13 @@
DROP DATABASE IF EXISTS `students`;
CREATE DATABASE students;
GRANT SELECT,INSERT,UPDATE,DELETE on students.* to haxo@'127.0.0.1' identified by 'haxo';
GRANT SELECT,INSERT,UPDATE,DELETE on students.* to haxo@localhost identified by 'haxo';
use students;
/**/ CREATE TABLE `information` (
`username` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`password` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
INSERT INTO `information` VALUES ('ikun', 'FLAGFLAGFLAG');

BIN
src/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

83
src/index.php Normal file
View File

@ -0,0 +1,83 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./shark.css">
<title>Document</title>
</head>
<body>
<div class="box">
<div class="jiangsir"></div>
<div class="jiangsir"></div>
<div class="jiangsir"></div>
<div class="jiangsir"></div>
</div>
<div class="form-box">
<div class="login-box">
<!-- ?? -->
<h1 class="title">
Sign in
</h1>
<!-- 图片盒子 -->
<div class="img-box">
<!-- 图片 -->
<img src="./images/woodpecker.png" alt="">
</div>
<!-- 输入框盒? -->
<div class="input-box">
<form action="index.php" method="POST">
<!-- 输入? -->
<input name="username" type="text">
<input name="password" type="text">
<input name="submit" type="submit"></input>
</form>
</div>
</div>
</div>
<p class="return"><?php
if (isset($_POST['submit'])) {
function error_die($msg)
{
echo $msg;
die();
}
include '_config.php';
$userLen = 4;
$username = $_POST['username'];
$password = $_POST['password'];
if (strlen($username) != $userLen) {
error_die("不是ikun???");
}
$query = "SELECT * FROM information WHERE username = '$username' AND password = '$password'";
$result = $link->query($query);
if (!$result) {
die("巅峰产生虚伪的拥护黄昏见证虔诚的信徒!!");
}
$row = $result->fetch_assoc();
if ($row == false) {
error_die("不是哥们用户名和密码不对啊");
} else {
$name = $row['username'];
$pass = $row['password'];
error_die("原来真的是你啊~" . $name . ",快收下坤坤的祝福". $pass ."");
}
}
?>
<p>
</body>
</html>

133
src/shark.css Normal file
View File

@ -0,0 +1,133 @@
* {
/* 去除浏览器默认内外边距 */
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
height: 100vh;
/* 溢出隐藏 */
overflow: hidden;
/* 设置弹性布局 */
display: flex;
justify-content: center;
align-items: center;
background-image: url(./images/image.png);
background-size: 100% 100%;
}
/* 表单盒子 */
.form-box {
position: absolute;
width: 400px;
height: 500px;
border-radius: 5px;
right: 40%;
/* 模糊,磨砂质感 */
backdrop-filter: blur(10px);
box-shadow: 2px 1px 19px rgba(0, 0, 0, .1);
z-index: 99;
}
.login-box,
.register-box {
/* 过渡动画 */
transition: 2s ease-in-out;
}
/* 一开始隐藏注册盒子 */
.register-box {
display: none;
}
/* 标题 */
.title {
margin-top: 50px;
text-align: center;
/* 设置用户禁止选中 */
user-select: none;
color: #fff;
/* 文字阴影 */
text-shadow: 4px 4px 3px rgba(0, 0, 0, .1);
}
/* 图片盒子 */
.img-box {
width: 100px;
height: 100px;
margin: 10px auto;
user-select: none;
border-radius: 50%;
/* 溢出隐藏 */
overflow: hidden;
box-shadow: 4px 4px 3px rgba(0, 0, 0, .1);
}
/* 图片 */
.img-box img {
width: 100%;
}
/* 输入框盒子 */
.input-box {
display: flex;
flex-direction: column;
align-items: center;
}
/* 输入框 */
input {
outline: none;
width: 60%;
height: 40px;
margin-bottom: 20px;
text-indent: 10px;
font-size: 16px;
font-weight: 500;
background-color: rgba(104, 76, 76, 0);
border-radius: 20px;
border: 1px solid #fff;
margin-left: 20%;
}
input::placeholder {
font-size: 14px;
font-weight: 400;
}
input:focus::placeholder {
opacity: 0;
}
/* 按钮盒子 */
.btn-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
/* 按钮 */
button {
width: 100px;
height: 30px;
margin-bottom: 10px;
border: none;
color: #fff;
font-size: 16px;
border-radius: 4px;
background-color: #c08f8a;
/* border: 1px solid #e6a49d; */
}
button:hover {
cursor: pointer;
}
.return {
position: absolute;
bottom: 10px;
}