Добавил:
Upload
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:
<?php
$path = $_GET['path'];
$dir = opendir($path);
$arDirs = array();
$arFiles = array();
while($file = readdir($dir)) {
if($file == '.' || $file == '..') continue;
if(is_dir($path.'/'.$file)) {
$arDirs[] = $file;
} else {
$arFiles[] = $file;
}
}
closedir($dir);
?>
<!DOCTYPE html>
<html>
<head>
<title>Lab10</title>
<meta http-equiv="Content-Type" content="text/html; charset=WINDOWS-1251">
</head>
<body>
<table border="1">
<tr>
<th>Папки</th>
<th>Файлы</th>
</tr>
<tr>
<td>
<ul>
<?php
foreach($arDirs as $file) {
echo '<li>'.$file.'</li>';
}
?>
</ul>
</td>
<td>
<ul>
<?php
foreach($arFiles as $file) {
echo '<li>'.$file.'</li>';
}
?>
</ul>
</td>
</tr>
</table>
<p><a href="index.php">Вернуться назад</a></p>
</body>
</html>
Соседние файлы в папке 10