<?php function saveMap($data) { $filename = "./maps/untitled.htc"; file_put_contents($filename, $data); echo "download.php?file=" . $filename; } $data = $_POST["data"]; if (isset($data)) { $data = stripslashes($data); saveMap($data); }
updatePickTableHeroes($matchId, $heroId, $connexion); updateMatchsTable($matchId, $playerId, $connexion); return "db updated"; case "getDataMaps": $matchId = $_POST['matchId']; $pickState = getDataMaps($matchId, $connexion); echo json_encode($pickState); break; case "getDataHeroes": $matchId = $_POST['matchId']; $pickState = getDataHeroes($matchId, $connexion); echo json_encode($pickState); break; case "saveMap": $matchId = $_POST['matchId']; saveMap($matchId, $connexion); return "map saved"; case "saveHeroes": $matchId = $_POST['matchId']; saveHeroes($matchId, $connexion); return "heroes saved"; case "getResultsOfPick": $matchId = $_POST['matchId']; $pickResult = getPickResults($matchId, $connexion); echo $pickResult; break; case "deleteTempTables": $matchId = $_POST['matchId']; deleteTempTables($matchId, $connexion); return "temp tables deleted"; default: