diff options
Diffstat (limited to 'deleteCharacter.php')
-rw-r--r-- | deleteCharacter.php | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/deleteCharacter.php b/deleteCharacter.php new file mode 100644 index 0000000..33e0b9b --- /dev/null +++ b/deleteCharacter.php @@ -0,0 +1,22 @@ +<?php +require_once(__DIR__.'/lib/commons/functions.common.inc.php'); +require_once(__DIR__.'/lib/commons/functions.http.inc.php'); +require_once(__DIR__.'/lib/commons/functions.files.inc.php'); +require_once(__DIR__.'/lib/functions.stories.inc.php'); + +//print_r($_POST);exit(); + +$storyName = getMandatoryPostParameter('story-name', NULL, true); +$charName = getMandatoryPostParameter('char-name', NULL, true); + +$pathToChar = generatePath(['stories', $storyName, $charName], __DIR__); +echo $pathToChar; +if (dir_exists($pathToChar)) { + rm_dir($pathToChar, TRUE); + echo "dir deleted"; +} else { + echo "dir does not exist"; + return 1; +} + +?> |