
<?php
session_start();
header('Content-type:text/html; Charset=utf-8');
$pw="25f9e794323b453885f5181f1b624d0b";
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $password = md5($_POST['password']);
    $_SESSION['userid'] = $password; 
    if($password == $pw){
        $_SESSION['loggedin'] = true;
        header("Location: dashboard.php");
        exit();
    }else{$error = "密码错误或账户无效";}
    
}
?>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>登录fg8888.cn</title>
    <style>
        body { font-family: Arial; background: #f0f2f5; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
        .login-container { width: 100%; max-width: 380px; background: #fff; padding: 20px; box-shadow: 0 0 10px rgba(0,0,0,0.1); border-radius: 8px; }
        input { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #ccc; border-radius: 4px; }
        button { width: 100%; padding: 10px; background: #007bff; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
        .error { color: red; font-size: 14px; }
    </style>
</head>
<body>
    <div class="login-container">
        <h2>管理员登录</h2>
        <?php if (isset($error)) echo "<p class='error'>$error</p>"; ?>
        <form method="post">
            <input style="width:95%" type="password" name="password" placeholder="请输入密码" required>
            <button type="submit">登录</button>
        </form>
    </div>
</body>
</html>
