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:
@@ -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
19
php/unlock.php
Normal 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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user