<?php
$postData = file_get_contents("php://input");

if(isset($postData) && !empty($postData)) {
    $request = json_decode($postData);
    // $username = trim($request->username);
    $dirname = trim($request->dirname);
    $path = trim($request->currdir) . '/' . $dirname;
    if(file_exists($path)) {
        $msg = "directory already exists";
        clearstatcache();
        echo json_encode($msg);
    }
    else {
        mkdir($path);
        clearstatcache();
    }

}
?>