This commit is contained in:
Trygve
2024-10-27 18:15:45 +01:00
parent 78c6f0e2dd
commit 35df188cf6
4 changed files with 78 additions and 66 deletions

View File

@@ -2,7 +2,16 @@
$control = $_POST['control'];
$runner_id = $_POST['id'];
$time = $_POST['time'];
$file = 'passering.csv';
$current = file_get_contents($file);
$current .= $control . "," . $runner_id . "," . $time . "\n";
file_put_contents($file, $current);
$password = $_POST['password'];
$hash = file_get_contents("hash.txt");
if (!password_verify($password, $hash)) {
http_response_code(response_code: 401);
}
else {
$file = 'passering.csv';
$current = file_get_contents($file);
$current .= $control . "," . $runner_id . "," . $time . "\n";
file_put_contents($file, $current);
}