summaryrefslogtreecommitdiffstats
path: root/deleteCharacter.php
blob: 33e0b9bbf4a032acdda1f4ca56210403e1cf35af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}

?>