I decided to teach php and when writing a simple file manager with the ability to go deep into folders I ran into a problem. After logging into the child folder, does not execute is_dir in a loop. those. folders which are inside do not turn around the link. while in the root, in the directory where the file being processed is located - everything is ok. Tell me where I was mistaken or what did I miss?
$dir = isset($_GET['link']) ? scandir($_GET['link']) : scandir('.'); if(isset($dir)) { foreach($dir as $i) { if($i != '.' && $i != '..') if(is_dir($i)) { echo '<p><strong><a href="/program.php?link='.(isset($_GET['link']) ? $_GET['link'].'/'.$i : $i).'">[ '.$i.' ]</a></strong></p>'; } else { echo '<p>'.$i.'</p>'; } } }