$author = $input['author']; $gamename = $input['gamename']; $description = $input['description']; $db = new DbHandler(); $res = $db->addxml($xml, $author, $gamename, $description); echo $res; }); $app->get('/xml', function () use($app) { $db = new DbHandler(); $res = $db->getxmls(); //var_dump($res); echoResponse(200, $res); }); $app->get('/xml/:id', function ($id) use($app) { $db = new DBHandler(); $res = $db->getxml($id); echoResponse(200, $res); }); $app->get('/deletexml/:id', function ($id) use($app) { $db = new DBHandler(); $res = $db->deletexml($id); echoResponse(200, $res); }); $app->post('/newcomment', function () use($app) { $json = $app->request->getBody(); $input = json_decode($json, true); $id = $input['id']; $author = $input['author']; $comment = $input['comment']; $db = new DbHandler(); $res = $db->addcomment($id, $author, $comment);