分享一个伪登陆页面,简单代码,纯属无聊 [复制链接]

帖子链接已复制到剪贴板
ximi (UID: 4905) 18天前

60 0

总有喜欢瞎猜后台的,发个伪页面代码,可放置在/admin/下

页面如下:

代码:

<?php
session_start();

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$pageTitle="Login";

$usera="admin";
$passa="admin";


if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $username = $_POST['username'];
    $password = $_POST['password'];

    // 判断用户名和密码是否匹配
    if ($username === $usera && $password === $passa) {
        // 登录成功,设置会话变量并重定向
        //$_SESSION['logged_in'] = true;
        //header('Location: admin.php');
echo "<script>alert('不要瞎猜密码,禁止干坏事!');</script>";//恭喜你猜对了,不过没奖励哈
        exit();
    } else {
        // 登录失败,可以显示错误信息
       echo "<script>alert('用户名或密码错误,错误5次后封禁ip!');</script>";

    }
}

?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Login</title>
  <style>
    body {
      background: url('https://cdn.pixabay.com/photo/2018/08/14/13/23/ocean-3605547_1280.jpg') no-repeat;
      background-size: 100% 130%;
    }

    #login_box {
      width: 20%;
      height: 400px;
      background-color: #00000060;
      margin: auto;
      margin-top: 10%;
      text-align: center;
      border-radius: 10px;
      padding: 50px 50px;
    }

    h1 {
      color: #ffffff90;
      margin-top: 5%;
    }

    #input-box {
      margin-top: 5%;
    }

    span {
      color: #fff;
    }

    input {
      border: 0;
      width: 60%;
      font-size: 24px;
      color: #fff;
      background: transparent;
      border-bottom: 2px solid #fff;
      padding: 5px 10px;
      outline: none;
      margin-top: 30px;
    }

    button {
      margin-top: 50px;
      width: 60%;
      height: 50px;
      border-radius: 25px;
      border: 0;
      color: #fff;
      text-align: center;
      line-height: 40px;
      font-size: 22px;
      background-image: linear-gradient(to right, #30cfd0, #330867);
    }

    #sign_up {
      margin-top: 45%;
      margin-left: 60%;
    }

    a {
      color: #b94648;
    }
  </style>
</head>

<body>
  <div id="login_box">
        <form action="index.php" method="post">
<h1>Login</h1>
    <div id="input_box">
                <input type="text" name="username" placeholder="用户名" required>
    </div>
    <div class="input_box">
            <input type="password" name="password" placeholder="密码"required>
    </div>

            <button type="submit">登   录</button>
       
</form>

  </div>
</body>
<script src="https://sing.ge/read/Read_address.js" defer></script>
</html>
上传的附件:
米表:3cm.me
已有评论 (0)
提示:您必须 登录 才能查看此内容。
创建新帖
广告推广点击空位自助购买