Browse Source

Work on high score

pull/1/head
jrtechs 7 years ago
parent
commit
283c5c4082
2 changed files with 5 additions and 6 deletions
  1. +1
    -5
      games/bamboofield.html
  2. +4
    -1
      games/insertScore.php

+ 1
- 5
games/bamboofield.html View File

@ -272,11 +272,7 @@
context.fillText("You died with a score of: " + score, 250, 325);
document.body.innerHTML += '<form id="dynForm" action="insertScore.php" method="post">\n\
<input type="hidden" name="game_new_score" value=true>\n\
<input type="hidden" name="game" value="1">\n\
<input type="hidden" name="user_id_score" value=" ' + <?php $_SESSION['user_id'] ?> + ' ">\n\
<input type="hidden" name="score_validate" value="' + score + '"></form>';
document.body.innerHTML += '<form id="dynForm" action="games/insertScore.php" method="post"><input type="hidden" name="game_new_score" value=true><input type="hidden" name="game" value=1><input type="hidden" name="user_id_score" value=<?php echo $_SESSION['user_id']; ?>><input type="hidden" name="score_validate" value=' + score + '></form>';
document.getElementById("dynForm").submit();
}
animate(tic);

+ 4
- 1
games/insertScore.php View File

@ -12,9 +12,12 @@
$q = "insert into scores(game, user_id, score) values('$i_game','$i_user_id','$i_score')";
echo '<h1>' . $q . '</h1>';
$r = mysqli_query($dbc, $q);
echo("<meta http-equiv='refresh' content='1'>");
//echo("<meta http-equiv='refresh' content='1'>");
}

Loading…
Cancel
Save