这是我的代码,我要做的是从原始目录的根目录中取出post.php或$file文件,然后将其放入这个uniqueID目录中,或者最终到达$newFolder5变量中完成。$root函数中的复制是指向当前目录中的文件的路径,那么当在页面加载时执行复制函数时,它应该转到$newFolder5目录。$root或副本的源可以是包含文件目录的字符串吗?
<?php
$unique = uniqid();
$root = '/gallry/' . $dir_auth1 . '/'. 'post.php';
$folder = mkdir($unique, 0755);
$uniqueFolder = '/' . $unique . '/' . 'post.php';
$destination2 = $dir_auth1 . '/' . $unique . '/' . 'post.php';
$newFolder = '/' . $dir_auth1 . $uniqueFolder;
if (!copy($root, $newFolder)) {
echo " status not created.";
} else {
echo "Success!";
}
?>我将$dir_auth1更改为'aidan',因为这是post.php所在的根目录。
简而言之,我要做的就是创建一个带有uniqid()的文件夹/目录,并将post.php放入其中。或者复制它。
https://stackoverflow.com/questions/38277929
复制相似问题