Verifica PHP

This commit is contained in:
Bildcraft1 2024-11-14 11:47:36 +01:00
parent ba05612a57
commit e7e4759083
52 changed files with 59839 additions and 0 deletions

View file

@ -0,0 +1,50 @@
<?php
include "includes/functions.php";
checkPost();
$_SESSION["nome"] = $_POST["nome"];
$_SESSION["sceltaHobby"] = $_POST["sceltaHobby"];
$domande = [];
if ($_POST["sceltaHobby"] == "m") {
$domande = json_decode(file_get_contents("includes/musica.json"));
} else if ($_POST["sceltaHobby"] == "s") {
$domande = json_decode(file_get_contents("includes/sport.json"));
}
createNecessaryCookies();
?>
<!DOCTYPE HTML>
<html lang="it">
<head>
<title>Login</title>
<?php require "includes/head.php" ?>
</head>
<body>
<div class="container">
<h1>Ciao <?php echo $_SESSION["nome"] ?></h1>
<h2>Rispondi alle seguenti domande</h2>
<form action="risultati.php" method="post">
<?php
foreach ($domande as $numeroDomanda => $domanda) {
echo '<div class="mb-3">';
echo '<label for="risposta_domanda_' . $numeroDomanda . '" class="form-label">' . $domanda[0] . '</label>';
echo '<input type="number" class="form-control" id="risposta_domanda_' . $numeroDomanda . '" name="risposta_domanda_' . $numeroDomanda . '">';
echo '</div>';
}
?>
<button type="submit" class="btn btn-primary">Invia voti</button>
</form>
</div>
<?php require "includes/footer.php" ?>
</body>
</html>