diff options
author | chai <chaifix@163.com> | 2022-03-18 23:38:15 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-03-18 23:38:15 +0800 |
commit | b970e38c6cbde1e573c1d7a1d1b1685c1ca5bde1 (patch) | |
tree | 1c61a26bf0970ce8fc0b2b11d547b926c403ef82 /checkadmin.php | |
parent | f63d8e742f6f1cd0321acfd9ffcfd71afd6c956d (diff) |
*admin login
Diffstat (limited to 'checkadmin.php')
-rw-r--r-- | checkadmin.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/checkadmin.php b/checkadmin.php new file mode 100644 index 0000000..305b211 --- /dev/null +++ b/checkadmin.php @@ -0,0 +1,13 @@ +<?php // 验证当前是否已经登录 + + session_start(); + if (isset($_SESSION["admin"]) && $_SESSION["admin"] === true) { + //echo "您已经成功登陆"; + require_once 'admin_header.php' ; + } else { + // 验证失败,将 $_SESSION["admin"] 置为 false + $_SESSION["admin"] = false; + header('Location: '.'login.php'); + } + +?>
\ No newline at end of file |