$dirPath1 = "users/$uniqueID"; #creating main folder and where $uniqueID will be called by a database when a user login.
$result = mkdir($dirPath1, 0755);
$dirPath2 = "users/$uniqueID/profile"; #sub folder
$result = mkdir($dirPath2, 0755);
$dirPath3 = "users/$uniqueID/images"; #sub folder
$result = mkdir($dirPath3, 0755);
$dirPath4 = "users/$uniqueID/uploads";#sub folder
$result = mkdir($dirPath4, 0755);
@copy('blank/dashboard.php', 'users/'.$uniqueID.'/dashboard.php');#from blank folder to dynamic user created folder
@copy('blank/views.php', 'users/'.$uniqueID.'/views.php'); #from blank folder to dynamic user created folder
@copy('blank/upload.php', 'users/'.$uniqueID.'/upload.php'); #from blank folder to dynamic user created folder
@copy('blank/delete.php', 'users/'.$uniqueID.'/delete.php'); #from blank folder to dynamic user created folder
<?php
// Copy the file from /user/desktop/geek.txt
// to user/Downloads/geeksforgeeks.txt'
// directory
// Store the path of source file
$source = '/user/Desktop/geek.txt';
// Store the path of destination file
$destination = 'user/Downloads/geeksforgeeks.txt';
// Copy the file from /user/desktop/geek.txt
// to user/Downloads/geeksforgeeks.txt'
// directory
if( !copy($source, $destination) ) {
echo "File can't be copied! \n";
}
else {
echo "File has been copied! \n";
}
?>
$source = "foo/fileA.txt";
$destination = "bar/"; // note how the destination has no file.
$newFile = "somefile.txt";
touch($destination . $newFile);
// then do the copy part
copy($source, $destination.$newFile);