finalizzazione del progetto

This commit is contained in:
2026-04-10 05:16:11 +02:00
parent 00e81f9da4
commit ba1717cbb6
24 changed files with 1650 additions and 389 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
// file per testare save_score.php
// richiesta post a save_score.php con i seguenti dati:
// nome: "Simone"
// score1: 120
// score2: 118
// scoreT: 80
$data = [
'nome' => 'TEST',
'score1' => 120,
'score2' => 118,
'scoreT' => 6611,
'data_partita' => date("Y-m-d")
];
// richiesta post a save_score.php con i dati richiesti
$options = [
'http' => [
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data),
],
];
$context = stream_context_create($options);
$result = file_get_contents('http://localhost:8888/php/save_score.php', false, $context);
if ($result === FALSE) {
echo "Errore nella richiesta";
} else {
echo "Punteggio salvato con successo";
}
?>