Onbekend |
|
Heb een script geschreven,
om te controleren of er extra toegankelijke paginas zijn
(aan de hand van user rankings),
maar het wil niet werken.
$standard = array("home","crew","news","services","incidents","contact");
$admin = array("add_news","change_news","delete_news","view_news");
$member = array("view_news");
$query = mysql_query("SELECT us_rank FROM users WHERE us_username = ".$_SESSION['username']".") or die(mysql_error());
$result = mysql_fetch_assoc($query);
if(isset($_GET['page']))
{
if(in_array($_GET['page'],$pages))
{
if(isset($_SESSION['login']))
{
if($result['us_rank'] == "admin")
{
$pages = array_merge($standard, $admin);
}
elseif($result['us_rank'] == "member")
{
$pages = array_merge($standard, $member);
}
}
else
{
echo("Je bent niet ingelogd.");
$pages = $standard;
}
include $_GET['page'].".php";
}
else
{
echo("Ongeldige pagina.");
}
}
?>
$standard = array("home","crew","news","services","incidents","contact"); $admin = array("add_news","change_news","delete_news","view_news"); $member = array("view_news"); { { if(isset($_SESSION['login'])) { if($result['us_rank'] == "admin") { } elseif($result['us_rank'] == "member") { } } else { echo("Je bent niet ingelogd."); $pages = $standard; } include $_GET['page'].".php"; } else { echo("Ongeldige pagina."); } } ?>
Alvast bedankt!
|