diff options
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."); + } + +?> |