From 688d1921aa8b14532a0c146e4500c0322139da62 Mon Sep 17 00:00:00 2001 From: SimonezYT Date: Fri, 10 Apr 2026 10:33:44 +0200 Subject: [PATCH] Update js/fase2.js --- js/fase2.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/fase2.js b/js/fase2.js index d9eb7b8..0369a0e 100644 --- a/js/fase2.js +++ b/js/fase2.js @@ -249,7 +249,7 @@ function mostraFineGioco() { const score2 = parseInt(localStorage.getItem('punteggioFase2')) || 0; const scoreT = 10_000 * ((score1 / MAX_SCORE) + (score2 / MAX_SCORE)) / 2; const data_partita = new Date().toISOString().split('T')[0]; // Formato YYYY-MM-DD - fetch('http://localhost:8888/php/save_score.php', { + fetch(`${SERVER_URL}/php/save_score.php`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' @@ -265,9 +265,10 @@ function mostraFineGioco() { .then(response => response.text()) .then(result => { console.log("Punteggio salvato con successo:", result); + window.location = "?pagina=end"; }) .catch(error => { console.error("Errore nella richiesta:", error); + window.location = "?pagina=end"; }); - window.location = "?pagina=end"; } \ No newline at end of file