summaryrefslogtreecommitdiff
path: root/authentication.php
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2022-03-18 23:38:15 +0800
committerchai <chaifix@163.com>2022-03-18 23:38:15 +0800
commitb970e38c6cbde1e573c1d7a1d1b1685c1ca5bde1 (patch)
tree1c61a26bf0970ce8fc0b2b11d547b926c403ef82 /authentication.php
parentf63d8e742f6f1cd0321acfd9ffcfd71afd6c956d (diff)
*admin login
Diffstat (limited to 'authentication.php')
-rw-r--r--authentication.php17
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.");
+ }
+
+?>