Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何计算用户使用/登录$_SESSION的次数并回显系统总计数?(假设$_SESSION['login])
$_SESSION
$_SESSION['login
提前致谢。
您可以将其存储在$_SESSION变量中,但它不可靠,用户可以轻松重置会话 cookie。我会做这样的事情:
if (user_logged_in) { $query = "UPDATE some_table SET total_logins = total_logins + 1 WHERE user_id = $userID"; $mysqli->query($query) or die($mysqli->error); }
希望这可以帮助!