Проблема в том, что все остальные также видят панель навигации, которая предназначена только для создателя этой страницы. (например, страница редактирования и т. д.).
Вот как мой скрипт проверяет, вошел ли пользователь в систему (я не могу это изменить)
Код: Выделить всё
if (!isset($_SESSION['userid']) || empty($_SESSION['userid'])) {
// If not logged in, redirect to the login page
header("Location: login.php");
exit();
}
Код: Выделить всё
$userid = $_SESSION["userid"];
$getuserdata = mysql_query("Select email, mtype, joindate from ".$prefix."members where Id=$userid");
$useremail = mysql_result($getuserdata, 0, "email");
$mtype = mysql_result($getuserdata, 0, "mtype");
Код: Выделить всё
// Determine if the current user is the creator of the page
$isCreator = ($userid == $page['user_id']);
// Add the header only if the current user is the creator
if ($isCreator) {
$pageContent .= "
[url=/members.php]Dashboard[/url]
[url=/instagram_embed_start.php]Edit Page[/url]
[url=/signup.php?rid=
Подробнее здесь: [url]https://stackoverflow.com/questions/79305231/hide-a-div-from-non-members[/url]
Мобильная версия