I Found a script.. Problem solved! //Copy a directory! define('loc1', '/var/www/html/xuonline'); //you can assign $username with a $_POST value. Think of the possibilities! $username = "kim"; $source = "/xuBlog/src/"; $dest = "/xuBlog/$username/"; mkdir(loc1.$dest); dircpy($source,$dest); function dircpy($source, $dest, $overwrite = false) { if($handle = opendir(loc1 . $source))// if the folder exploration is sucsessful, continue { while(false !== ($file = readdir($handle)))// as long as storing the next file to $file is successful, continue { if($file != '.' && $file != '..') { $path = $source . '/' . $file; if(is_file(loc1 . $path)) { if(!is_file(loc1 . $dest . '/' . $file) || $overwrite) if(!@copy(loc1 . $path, loc1 . $dest . '/' . $file)) { echo 'ERROR'; } } elseif(is_dir(loc1 . $path)) { if(!is_dir(loc1 . $dest . '/' . $file)) mkdir(loc1 . $dest . '/' . $file); // make subdirectory before subdirectory is copied dircpy($path, $dest . '/' . $file, $overwrite); //recurse! } } } closedir($handle); } } // end of dircpy()