-
Notifications
You must be signed in to change notification settings - Fork 0
/
create.php
40 lines (32 loc) · 761 Bytes
/
create.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
if ($_SERVER['REQUEST_METHOD'] == "POST") {
if (isset($_POST['create'])) {
$path = $_POST['path'];
$create = $_POST['create'];
if ($create == "folder") {
$folder = $_POST['folder'];
$folder = $path."/".$folder;
try {
$bool = mkdir($folder);
if ($bool == true) {
echo "success";
}
}catch (Exception $e){
echo 'Message: ' .$e->getMessage();
}
}
if ($create == "file") {
$file = $_POST['file'];
$file = $path."/".$file;
try {
$bool = fopen($file, "w");
if ($bool == true) {
echo "success";
}
}catch(Exception $e){
echo 'Message: ' .$e->getMessage();
}
}
}
}
?>