wrong mode in index.php now gives a 404 error (#15); anti cross-site-request token

This commit is contained in:
Fabian de Boer 2026-07-19 21:27:13 +02:00
commit ab0ac45415
4 changed files with 48 additions and 1 deletions

View file

@ -12,7 +12,11 @@
<!--input modus: words-->
<div id="inpWords" class="inpSection">
<h2>Input words</h2>
<?php if (empty($_SESSION['csrf_token'])) {
$_SESSION['csrf_token'] = bin2hex(random_bytes(16));
} ?>
<form id="form1" action="index.php?mode=display" method="post">
<input type="hidden" name="csrf_token" value="<?= $_SESSION['csrf_token'] ?>">
<?php for ($i = 1; $i <= MAX_WORDS; $i++) : ?>
<?php $nr = sprintf("%02d", $i); ?>
<div class="inp">