Update js/fase2.js

This commit is contained in:
2026-04-10 10:33:44 +02:00
parent 25bc5a1374
commit 688d1921aa
+3 -2
View File
@@ -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";
});
}