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:
sraffauf
2026-01-22 17:59:44 +01:00
parent e2261ff0dd
commit f24151c21c
3 changed files with 4 additions and 4 deletions

View File

@@ -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>

View File

@@ -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>

View File

@@ -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!");
} }