\n返回目录\n数据数量\n";
echo "
\n";
echo "\n";
echo "
\n";
if (isset($_POST['createtype']) && isset($_POST['createpath'])) if (is_array($_POST['createtype']) && is_array($_POST['createpath'])) if (count($_POST['createtype']) == count($_POST['createpath']) && count($_POST['createtype']) > 0) {
$o = 0;
$i = 0;
echo "批量创建数据报告
\n";
while ($i < count($_POST['createtype'])) {
$createtype = trim($_POST['createtype'][$i]);
$createpath = trim($_POST['createpath'][$i]);
if ($getcwd == $createpath || $createpath == "") {
$i++;
continue;
}
if ($createtype == "dir") {
if (!strstr($createpath, "/") && !strstr($createpath, "\\")) {
if (mkdir($getcwd . "/" . $createpath, 0755)) {
echo "\n";
echo "文件目录 $createpath 成功创建\n";
echo "
\n";
} else {
echo "\n";
echo "文件目录 $createpath 无法创建\n";
echo "
\n";
}
} else {
if (mkdir($createpath, 0755)) {
echo "\n";
echo "文件目录 $createpath 成功创建\n";
echo "
\n";
} else {
echo "\n";
echo "文件目录 $createpath 无法创建\n";
echo "
\n";
}
}
} elseif ($createtype == "file") {
if (!strstr($createpath, "/") && !strstr($createpath, "\\")) {
if (file_exists($getcwd . "/" . $createpath)) {
echo "\n";
echo "文件路径 $createpath 已经存在\n";
echo "
\n";
} else {
if (!($fp = fopen($getcwd . "/" . $createpath, "w"))) {
echo "\n";
echo "空白文件 $createpath 无法创建\n";
echo "
\n";
} else {
fclose($fp);
echo "\n";
echo "空白文件 $createpath 成功创建\n";
echo "
\n";
}
}
} else {
if (file_exists($createpath)) {
echo "\n";
echo "文件路径 $createpath 已经存在\n";
echo "
\n";
} else {
if (!($fp = fopen($createpath, "w"))) {
echo "\n";
echo "空白文件 $createpath 无法创建\n";
echo "
\n";
} else {
fclose($fp);
echo "\n";
echo "空白文件 $createpath 成功创建\n";
echo "
\n";
}
}
}
}
$o++;
$i++;
}
if ($o < 1) echo "郁闷,没有任何文件被操作!\n";
}
echo "定义创建数据路径
\n";
echo "\n";
xhtml_footer();
?>