") === FALSE){ $output["success"] = 0; $output["msg"] = "The folder name is invalid."; header("Content-type: text/plain;"); echo json_encode($output); exit(); } $old = umask(0); if(!mkdir($new_folder, 0777)){ $output["success"] = 0; $output["msg"] = "The folder could not be created."; header("Content-type: text/plain;"); echo json_encode($output); exit(); } umask($old); include 'contents.php'; header("Content-type: text/plain;"); echo json_encode($output); exit();