fixed redirect to admin login and minor bug
Fixed redirect to the admin page by actually calling the login function. Also fixed file path of logo in admin.php
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
<h2>Admin Login</h2>
|
<h2>Admin Login</h2>
|
||||||
<img src="../img/csg.png" width="100" />
|
<img src="../img/csg.png" width="100" />
|
||||||
</div>
|
</div>
|
||||||
<form id="loginForm">
|
<form id="loginForm" action="../php/login.php" method="post">
|
||||||
<label for="username">Benutzername</label>
|
<label for="username">Benutzername</label>
|
||||||
<input type="text" id="username" name="username" required />
|
<input type="text" id="username" name="username" required />
|
||||||
<label for="password">Passwort</label>
|
<label for="password">Passwort</label>
|
||||||
@@ -21,6 +21,6 @@
|
|||||||
</form>
|
</form>
|
||||||
<p id="errorMsg" style="color: red;"></p>
|
<p id="errorMsg" style="color: red;"></p>
|
||||||
</div>
|
</div>
|
||||||
<script src="../js/login.js"></script>
|
<!--<script src="../js/login.js"></script>-->
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ if (!isset($_SESSION["loggedIn"])) {
|
|||||||
<div class="container-dashboard">
|
<div class="container-dashboard">
|
||||||
<div class="header-with-image">
|
<div class="header-with-image">
|
||||||
<h2>Admin Dashboard</h2>
|
<h2>Admin Dashboard</h2>
|
||||||
<img src="img/csg.png" width="100" />
|
<img src="../img/csg.png" width="100" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<a href="../php/logout.php" class="logout-btn">Logout</a>
|
<a href="../php/logout.php" class="logout-btn">Logout</a>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ session_start();
|
|||||||
$username = $_POST['username'] ?? '';
|
$username = $_POST['username'] ?? '';
|
||||||
$password = $_POST['password'] ?? '';
|
$password = $_POST['password'] ?? '';
|
||||||
|
|
||||||
$usersFile = __DIR__ . "../data/users.json";
|
$usersFile = "../data/users.json";
|
||||||
if (!file_exists($usersFile)) {
|
if (!file_exists($usersFile)) {
|
||||||
die("Benutzerdaten fehlen!");
|
die("Benutzerdaten fehlen!");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user