<?php
// absolute path can be set by ?path = in browser window
$absolute_path = "path to files";
// set link properties
$dl = $absolute_path . "viewcode.php?path=&file=";
read the directory
$dir = opendir($absolute_path);
while ($file = readdir($dir))
{
// if the file is text list it all other files ignore
if (($file != "..") && ($file != ".") && !strstr($file, '.txt'))
{
//convert the filename to having no extension (optional)
$filename = eregi_replace('.[a-z]+$','',$file);
$list .= "<a href='$dl$file'>$filename</a><br>";
}
}
// this lists the files and redircts them to your editpage
echo $list;
?>
to set the $path for multilevel opening
<?php
if (isset($GET['path'])){
$path = $GET['path'] ;
}
else {
$path = "absolute path to default directory";
}
?>
Have Fun🆒