How to make, what would the transition to folders, was using the GET method? I can not understand.
<?php error_reporting(-1); header('Content-Type: text/html; char set=utf-8'); ini_set('display_errors', 'On'); $img = 'papka.jpg'; $img2 = 'file.jpg'; $img3 = 'img.jpg'; $dir = __DIR__; $files = scandir($dir); echo '<ul style="padding: 0">'; foreach ($files as $f) { echo '<li style="list-style: none;">'; if(pathinfo($f, PATHINFO_EXTENSION) == 'txt'){ echo '<img src="' . $img2 . '">'; echo '<span style="display: inline-block; vertical-align: top; padding-left: 3px;">' . $f .'</span>'; } elseif(pathinfo($f, PATHINFO_EXTENSION) == 'jpg'){ echo '<img src="' . $img3 . '">'; echo '<span style="display: inline-block; vertical-align: top; padding-left: 3px;">' . $f .'</span>'; } elseif(is_dir($dir . '/' . $f)){ echo '<a href="?papka=' . $f . '">'; echo '<img src="' . $img . '">'; echo '<span style="display: inline-block; vertical-align: top; padding-left: 3px;">' . $f . '</span>'; echo '</a>'; } echo '</li>'; } echo '</ul>'; ?>