Jump to content

Max21

Members
  • Posts

    2
  • Joined

  • Last visited

Max21's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Max21

    Login user leven

    What code do I do? thank you for your advice
  2. Max21

    Login user leven

    Hello, I am Max and new here. sorry for the spelling but my English is not so good. I create a website in php. after logging in I will go to the "Home.pgp". Now I do not want to show all navagation buttons for certain level users on the home page. how can I do this best? have already tried everything but do not get out of it. I have a sql database with username, password and level (admin / user / service) this is my code from the home page in which I enter the username of the login call : <?php // Include config file require_once 'config.php'; // Initialize the session session_start(); // If session variable is not set it will redirect to login page if(!isset($_SESSION['gebruikersnaam']) || empty($_SESSION['gebruikersnaam'])){ header("location: Index.php"); exit; } ?> <!DOCTYPE html> <html> <title>Mack Projects @ Techniek</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <link rel="stylesheet" href="Css/Index.css"> <style> html,body,h1,h2,h3,h4,h5 {font-family: "Raleway", sans-serif} </style> <body class="w3-light-grey"> <!-- Top container --> <div class="w3-bar w3-top w3-black w3-large" style="z-index:4"> <button class="w3-bar-item w3-button w3-hide-large w3-hover-none w3-hover-text-light-grey" onclick="w3_open();"><i class="fa fa-bars"></i> Menu</button> <span class="w3-bar-item w3-left"><img src="Afbeeldingen/Index/Techniek_Poppetje_Home.jpg"> </span> <span class="w3-bar-item w3-right">Mack Projects @ Techniek</span> </div> <!-- Sidebar/menu --> <nav class="w3-sidebar w3-collapse w3-white w3-animate-left" style="z-index:3;width:300px;" id="mySidebar"><br> <div class="w3-container w3-row"> <div class="w3-col s4"> <img src="/w3images/avatar2.png" class="w3-circle w3-margin-right" style="width:46px"> </div> <div class="w3-col s8 w3-bar"> <span><br><br> Welkom <b><?php echo htmlspecialchars($_SESSION['gebruikersnaam']); ?></b></span><br> <a href="#" class="w3-bar-item w3-button"><i class="fa fa-envelope"></i></a> <a href="#" class="w3-bar-item w3-button"><i class="fa fa-user"></i></a> <a href="#" class="w3-bar-item w3-button"><i class="fa fa-cog"></i></a> </div> </div> <hr> <div class="w3-container"> <h5>Dashboard</h5> </div> <div class="w3-bar-block"> <a href="#" class="w3-bar-item w3-button w3-padding-16 w3-hide-large w3-dark-grey w3-hover-black" onclick="w3_close()" title="close menu"><i class="fa fa-remove fa-fw"></i> Close Menu</a> <a href="#" class="w3-bar-item w3-button w3-padding w3-blue"><i class="fa fa-users fa-fw"></i> Overview</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-eye fa-fw"></i> Views</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-users fa-fw"></i> Traffic</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-bullseye fa-fw"></i> Nieuws</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-diamond fa-fw"></i> ToDo</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-bell fa-fw"></i> Agenda</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-bank fa-fw"></i> Magazijn</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-history fa-fw"></i> Zone's</a> <a href="#" class="w3-bar-item w3-button w3-padding"><i class="fa fa-cog fa-fw"></i> Instellingen</a><br><br> </div> I want to thank you for the help! this is something purely as a hobby and not commercial that I do this
×
×
  • Create New...