Added password lock to ticket system

Created php file to redirect to the ticket submit page when entering
right password
This commit is contained in:
sraffauf
2026-01-22 17:09:45 +01:00
parent 5b2fcb5586
commit e28948372b
2 changed files with 20 additions and 1 deletions

View File

@@ -12,7 +12,7 @@
<h2>CSG Ticketsystem</h2> <h2>CSG Ticketsystem</h2>
<img src="./img/csg.png" width="100"/> <img src="./img/csg.png" width="100"/>
</div> </div>
<form action="" method="post"> <form action="./php/unlock.php" method="post">
<input type="password" name="password" id="password" placeholder="Passwort" required/> <input type="password" name="password" id="password" placeholder="Passwort" required/>
<button type="submit">Login</button> <button type="submit">Login</button>
</form> </form>

19
php/unlock.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
session_start();
$pass = "test123";
$try = $_POST['password'] ?? '';
$unlocked = false;
if ($pass === $try) {
$unlocked = true;
}
if ($unlocked) {
$_SESSION['unlocked'] = true;
header("Location: ./ticket_lock.php");
exit;
} else {
header("Location: ../index.html?error=1");
exit;
}