欢迎来到牛博站长教程网!

PHP源码

当前位置: 主页 > 源码下载 > PHP源码

分享一个伪登陆页面,简单代码,纯属无聊

时间:2024-09-29 10:10:24|栏目:PHP源码|点击:

总有喜欢瞎猜后台的,发个伪页面代码,可放置在 /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>
<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>
            <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>


转自:https://www.dalao.net/thread-34726.ht

  • 立即下载
  • 上一篇:一个留言板源码

    栏    目:PHP源码

    下一篇:暂无

    本文标题:分享一个伪登陆页面,简单代码,纯属无聊

    本文地址:https://nb.sd.cn/PHPyuanma/307.html

    广告投放 | 联系我们 | 版权申明

    重要申明:本站所有的文章、图片、评论等,均由网友发表或上传并维护或收集自网络,属个人行为,与本站立场无关。本站涉及源码和程序均为学习用途,无商业盈利

    如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

    联系QQ:44281525 | 邮箱:44281525@qq.com

    Copyright © 2002-202X 牛博站长教程网 版权所有 Powered by EyouCms鲁ICP备2024061276号-1