diff --git a/index.php b/index.php index cfc9b20..4e0238d 100644 --- a/index.php +++ b/index.php @@ -1,15 +1,9 @@ LARGEUR_MAX ] ]); -$id = htmlspecialchars($_GET["grille"]); + +if (isset($_GET["grille"])) { + $id = htmlspecialchars($_GET["grille"]); +} else { + $id = uniqid(); +} $grille = new Grille($hauteur, $largeur, $id); $grille->current(); if ($grille->valid()) { + if (!isset($_GET["grille"])) { + $_GET["grille"] = $id; + header("Location: " . dirname($_SERVER['DOCUMENT_URI']) . "?" . http_build_query($_GET)); + exit; + } + $definitions_horizontales = []; foreach ($grille->lignes as $y => $mots) { $definitions_horizontales[$y] = [];