2021-10-18T11:41:31.png

登陆代码

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        
        body,
        html {
            width: 100%;
            height: 100%;
            background: linear-gradient(45deg, palegoldenrod, pink, plum);
            overflow: hidden;
        }
        
        .cont {
            width: 400px;
            height: 400px;
            /* background: linear-gradient(45deg, paleturquoise, powderblue, skyblue); */
            background: powderblue;
            box-shadow: 3px 3px 10px powderblue;
            margin: 150px auto;
        }
        
        .input {
            width: 70%;
            margin-bottom: 20px;
            outline: none;
            border: 0;
            padding: 10px 0px;
            border-bottom: 2px solid rgba(60, 60, 70);
            font: 900 16px;
            margin-left: 15%;
            margin-top: 30px;
            background: powderblue;
        }
        
        .submit {
            width: 50%;
            height: 60px;
            line-height: 60px;
            color: #fff;
            background: linear-gradient(90deg, #03a9f4, #f441a5);
            border-radius: 30px;
            border: none;
            margin-left: 25%;
            margin-top: 20px;
            transition: all 0.5s;
            cursor: pointer
        }
        
        .submit:hover {
            box-shadow: 0px 0px 5px #f441a5;
        }
    </style>
</head>

<body>
    <div class="cont">
        <form action="login.php" method="get">
            <input type="text" placeholder="admin" class="input" name="user">
            <input type="password" placeholder="admin" class="input" name="password">
            <input type="submit" value="登陆" class="submit">
        </form>

    </div>
</body>

</html>

这个登陆界面主要是我学习PHP时写的
下面附上PHP简单验证代码

  <?php 
    if($_GET["user"]=="admin"&&$_GET["password"]=="admin"){//逻辑与判断获取的用户名密码是否为admin,后面插入数据库查询代码
        echo "正确";
    }else{
        echo "错误";
    };

  ?>
最后修改:2021 年 10 月 18 日 07 : 45 PM
如果觉得我的文章对你有用,请随意赞赏