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

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

}
?>