Prepare statements for sql queries, use (int) to avoid nonint inputs

The goal of this edit is to prevent sql injection.
For string inputs like player name -> prepare sql statements.
For other inputs that are integers -> cast to int via (int)
This commit is contained in:
foin137
2020-04-05 18:16:30 +02:00
parent 873efe4cd9
commit ca7588ec86
2 changed files with 89 additions and 56 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Pragma: no-cache');
$spielID = $_GET['game'];
$spielID = (int)$_GET['game'];
if ($Result = $mysqli->query("SELECT * FROM ".$spielID."_game"))
{