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>
|
||||
<img src="../img/csg.png" width="100" />
|
||||
</div>
|
||||
<form id="loginForm">
|
||||
<form id="loginForm" action="../php/login.php" method="post">
|
||||
<label for="username">Benutzername</label>
|
||||
<input type="text" id="username" name="username" required />
|
||||
<label for="password">Passwort</label>
|
||||
@@ -21,6 +21,6 @@
|
||||
</form>
|
||||
<p id="errorMsg" style="color: red;"></p>
|
||||
</div>
|
||||
<script src="../js/login.js"></script>
|
||||
<!--<script src="../js/login.js"></script>-->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -16,7 +16,7 @@ if (!isset($_SESSION["loggedIn"])) {
|
||||
<div class="container-dashboard">
|
||||
<div class="header-with-image">
|
||||
<h2>Admin Dashboard</h2>
|
||||
<img src="img/csg.png" width="100" />
|
||||
<img src="../img/csg.png" width="100" />
|
||||
</div>
|
||||
|
||||
<a href="../php/logout.php" class="logout-btn">Logout</a>
|
||||
|
||||
@@ -4,7 +4,7 @@ session_start();
|
||||
$username = $_POST['username'] ?? '';
|
||||
$password = $_POST['password'] ?? '';
|
||||
|
||||
$usersFile = __DIR__ . "../data/users.json";
|
||||
$usersFile = "../data/users.json";
|
||||
if (!file_exists($usersFile)) {
|
||||
die("Benutzerdaten fehlen!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user