prepare("SELECT * FROM users WHERE username = ?"); $stmt->execute([$username]); $user = $stmt->fetch(); if ($user && password_verify($password, $user['password'])) { $_SESSION['user_id'] = $user['id']; $_SESSION['username'] = $user['username']; $_SESSION['role'] = $user['role']; if ($user['role'] === 'admin') { header("Location: admin/index.php"); } else { header("Location: index.php"); } exit; } else { $error = '用户名或密码错误'; } } $page_title = '登录 - 豪软世界'; require_once 'includes/header.php'; ?>
H

欢迎回来

登录以管理您的订单和账户

还没有账号? 立即注册
测试账号: admin / admin123