SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Threaded View
-
Jul 1, 2009, 02:13 #1
- Join Date
- Oct 2004
- Location
- uk
- Posts
- 853
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
copying contents of folders to another
Hi guys. This is the script I am using to move files from one folder to another.
PHP Code:$foldername=$_POST['foldername'];
if(!file_exists($foldername)) {
mkdir("$foldername/", 0777);
}
$source = '../files';
$dest= "$foldername";
$handle = opendir($source);
// Loop through all files in dir
while (false !== ($file = readdir($handle))) {
copy($file, $dest . '/' . $file);
}
closedir($handle);
}
The issue is it moves all the files over fine but the folders dont get moved over
What could cause this?
Regards
Chris
Bookmarks