Post
#1
|
|
|
Grupa: Zarejestrowani Postów: 256 Pomógł: 0 Dołączył: 19.07.2006 Skąd: Ostrów Wielkopolski Ostrzeżenie: (0%)
|
Witam potrzbuję pilnie skrypt który skopiuje mi pliki z katalogu na serwerze www.costam.pl/katalog/ na serwer www.blebleble.com/katalog2/ (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
ew. ten drugi serwer to moze byc dysk twardy naszego komputera BYŁ BYM NIEZMIERNIE WDZIĘCZNY za odpowiedz (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) . |
|
|
|
![]() |
Post
#2
|
|
|
Grupa: Zarejestrowani Postów: 634 Pomógł: 14 Dołączył: 27.05.2006 Skąd: Berlin Ostrzeżenie: (0%)
|
Kod <?php // copy a directory and all subdirectories and files (recursive) // void dircpy( str 'source directory', str 'destination directory' [, bool 'overwrite existing files'] ) function dircpy($basePath, $source, $dest, $overwrite = false){ if(!is_dir($basePath . $dest)) //Lets just make sure our new folder is already created. Alright so its not efficient to check each time... bite me mkdir($basePath . $dest); if($handle = opendir($basePath . $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($basePath . $path)){ if(!is_file($basePath . $dest . '/' . $file) || $overwrite) if(!@copy($basePath . $path, $basePath . $dest . '/' . $file)){ echo '<font color="red">File ('.$path.') could not be copied, likely a permissions problem.</font>'; } } elseif(is_dir($basePath . $path)){ if(!is_dir($basePath . $dest . '/' . $file)) mkdir($basePath . $dest . '/' . $file); // make subdirectory before subdirectory is copied dircpy($basePath, $path, $dest . '/' . $file, $overwrite); //recurse! } } } closedir($handle); } } ?> to jest w komentarzach w manualu Ten post edytował nasty_psycho 30.07.2006, 10:35:00 |
|
|
|
dawhol [php] PILNE Kopiowanie plików z katalogn do innego katalogu 30.07.2006, 10:26:30
nasty_psycho http://php.net/pl/copy 30.07.2006, 10:28:31
piotrd nie krzycz w poście.
czy chodzi Ci o cos takiego -... 30.07.2006, 10:30:32
dawhol Zalezało by mi na gotowcu wiem ze to forum sluzy ... 30.07.2006, 10:31:41
dawhol problem w tym ze nieznam loginu adresu ftp i hasla... 30.07.2006, 10:34:41
nasty_psycho nio, ale tu nie trzeba miec usera i password, wyst... 30.07.2006, 10:36:29
dawhol [PHP] pobierz, plaintext <?php$source = 'http:/... 30.07.2006, 10:40:49
nasty_psycho skopjuj jeszcze raz kod ktory ci podalem, bo tamto... 30.07.2006, 10:46:45
dawhol niewiem moze jestem za ciemny ale nada mi nie dzia... 30.07.2006, 10:57:08 ![]() ![]() |
|
Aktualny czas: 27.12.2025 - 09:26 |