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 /authentication.php | |
parent | f63d8e742f6f1cd0321acfd9ffcfd71afd6c956d (diff) |
*admin login
Diffstat (limited to 'authentication.php')
-rw-r--r-- | authentication.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/authentication.php b/authentication.php new file mode 100644 index 0000000..882650f --- /dev/null +++ b/authentication.php @@ -0,0 +1,17 @@ + +<?php // 验证登录 + + require_once 'config.php' ; + + $token = $_POST['token']; + + if($token == Config::$admin_token){ + session_start(); + $_SESSION['admin'] = true; + setcookie(session_name(), session_id(), time() + $lifeTime); + header('Location: '.'admin.php'); + } else { + die("Wrong token."); + } + +?> |