: function count_files($dir){ $c=0; $d=dir($dir); while($str=$d->read()){ if($str{0}!='.'){ if(is_dir($dir.'/'.$str)) $c+=count_files($dir.'/ '.$str); else $c++; }; } $d->close(); return $c; } ... ............................ , <?php function upload_form() { ?> <form method="POST" enctype="multipart/form-data" action="<? echo $_SERVER['PHP_SELF'] ?>"> <input type="file" name="userfile"> <input type="submit" name="action" value=""> </form> <? } function upload_file() { $archive_dir=" "; $userfile_name=$_FILES['userfile'] ['name']; $userfile_tmp_name=$_FILES['userfile'] ['tmp_name']; $userfile_size=$_FILES['userfile'] ['size']; $userfile_type=$_FILES['userfile'] ['type']; if(isset($_ENV['WINDIR'])) { $userfile=str_replace("\\\\","\\", $_FILES['userfile'] ['name'] ) ; } $filename=basename($userfile_name); if($userfile_size <= 0) die (" $filename ."); if(!@move_uploaded_file($userfile_tmp_name, "archive_dir/$filename")) die(" $userfile_name $filename."); if(isset($_ENV['WINDIR'])&&!@unlink($userfile)) die (" $userfile_name."); echo " $filenam$filename .<br/>"; echo " : ".number_format($userfile_size)."<br/>"; echo " : $userfile_type<br/>"; } ?> <?php if($_POST[action]=='') { upload_file(); }else{ upload_form(); } ?> //////////////////////// function dir_scan($patch){ global $item; $num = 1; $dir = opendir($patch); while(($it = readdir($dir)) !== false){ if($it == '.' || $it == '..' || $it=='info.txt' || $it=='cat.txt'){ continue; } if(is_dir($patch.$it)){ $item[$num]['type'] = 'd'; $item[$num]['name'] = dirname($patch.$it."/"); } else{ $item[$num]['name'] = basename($patch.$it, '.txt'); $item[$num]['type'] = 'f'; $item[$num]['size'] = ceil(filesize($patch.$it)/1024); } $item[$num]['patch'] = $patch.$it; $item[$num]['time'] = filemtime($patch.$it); $num++; } closedir($dir); return $item; } . $item[$num]['type'] = 'd'; if($item[$num]['type'] == 'd'){ dir_scan($item[$num]['name']); echo "......"; .... .. ... } ////////////////////////// /* - + . Fashion */ $dir='.'; // . - || ../ - || papka - set_time_limit(0); function dirs($in){ $razmer=0; $dir=scandir($in); foreach($dir as $file){ if(is_file($in.'/'.$file)){ $razmer=$razmer+filesize($in.'/'.$file); //echo $in.'/'.$file.'<br/>'; }elseif(is_dir($in.'/'.$file) and
далее
перейти
в начало
В библиотеку

на главную



..
(c) xika.ru