Dodanie ekranu logowania, do zrobienia połączyć to z poprzednim projektem z lekcji 2
This commit is contained in:
1 parent
83672909f4
commit
c198d9d70a
12 files changed
+351
No files matched your search
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if(!isset($_SESSION['logged'])) {
|
||||
header("Location: login.php");
|
||||
exit();
|
||||
}
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="pl">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Projekt</title>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
font-family: Arial;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: cornflowerblue;
|
||||
}
|
||||
|
||||
.container {
|
||||
border: 1px solid black;
|
||||
box-shadow: 5px 5px 0px black;
|
||||
background-color: beige;
|
||||
width: fit-content;
|
||||
margin: 1em auto;
|
||||
padding: 1em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<h1>SIEMANDEROOO</h1>
|
||||
<p>Jesteś zalogowany jako <span style="font-weight: bold;"><?= $_SESSION['username'] ?></span>.</p><br>
|
||||
|
||||
<?php
|
||||
if($_SESSION['user_rights_level'] >= 1) {
|
||||
echo '<a href="">Przeglądaj treści...</a>';
|
||||
}
|
||||
if($_SESSION['user_rights_level'] >= 2) {
|
||||
echo '<br><a href="">Dodaj treści...</a>';
|
||||
}
|
||||
if($_SESSION['user_rights_level'] >= 3) {
|
||||
echo '<br><a href="">Modyfikuj/usuń treści...</a>';
|
||||
}
|
||||
?>
|
||||
|
||||
<br><br><a href="logout.php">Wyloguj</a>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in new issue
Block a user