diff --git a/Backend/Controllers/FileHandler/upload.php b/Backend/Controllers/FileHandler/upload.php index 0adc277..ce07679 100644 --- a/Backend/Controllers/FileHandler/upload.php +++ b/Backend/Controllers/FileHandler/upload.php @@ -4,6 +4,10 @@ use Backend\Models\GameData; $isImages = false; +session_start(); + +if(isset($_SESSION['token'])){ + if(isset($_POST['submitUpload'])){ //Get the data from the user form $gameFile = $_FILES['gameFile']; @@ -46,7 +50,6 @@ if(isset($_POST['submitUpload'])){ header("location: ../../../Frontend/index.php?error=emptyFile"); exit(); }else{ - $gameData = new GameData(); $gameData->game_name = $title; $gameData->game_link = $gameFileNewName; @@ -68,4 +71,6 @@ if(isset($_POST['submitUpload'])){ echo "Wrong file type"; } +} + } \ No newline at end of file