diff --git a/assets/pasted-20260208-123344-c6190c96.png b/assets/pasted-20260208-123344-c6190c96.png new file mode 100644 index 0000000..b36e5d6 Binary files /dev/null and b/assets/pasted-20260208-123344-c6190c96.png differ diff --git a/includes/header.php b/includes/header.php index dd64021..466b6f7 100644 --- a/includes/header.php +++ b/includes/header.php @@ -1,6 +1,8 @@ - + 后台管理 - - 登录 diff --git a/login.php b/login.php index 66ac155..8f3f7be 100644 --- a/login.php +++ b/login.php @@ -18,6 +18,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $_SESSION['role'] = $user['role']; if ($user['role'] === 'admin') { + $_SESSION['admin_logged_in'] = true; header("Location: admin/index.php"); } else { header("Location: index.php"); @@ -59,19 +60,11 @@ require_once 'includes/header.php'; -
- 还没有账号? 立即注册 -
-
-
- 测试账号: admin / admin123 -
-
- + \ No newline at end of file diff --git a/register.php b/register.php index a71ad56..c0c0953 100644 --- a/register.php +++ b/register.php @@ -1,82 +1,4 @@ prepare("INSERT INTO users (username, password, email, role) VALUES (?, ?, ?, 'user')"); - $stmt->execute([$username, $hashed, $email]); - $success = '注册成功,请登录'; - } catch (PDOException $e) { - $error = '用户名或邮箱已存在'; - } - } -} - -$page_title = '注册 - 豪软世界'; -require_once 'includes/header.php'; -?> - -
-
-
-
-
-
-

加入我们

-

开启您的软件选购之旅

-
- - -
- -
- - - -
- -
- - -
-
- - -
-
- - -
-
- - -
-
- - -
- -
- 已有账号? 立即登录 -
-
-
-
-
-
-
- - +header("Location: index.php"); +exit; +?> \ No newline at end of file