PHP-Code:
<?PHP
echo " <table width=\"97%\" align=\"left\" cellpadding=\"20\">\n";
echo " <tr>\n";
echo " <td>\n";
function show_dir($dir, $pos=2)
{
if($pos == 2)
{
echo "<pre>";
}
$handle = @opendir($dir);
while ($file = @readdir ($handle))
{
if (eregi("^.{1,2}$",$file))
{
continue;
}
if(is_dir($dir.$file))
{
printf ("% ".$pos."s <b>%s</b>\n", "<a href=\"index2.php?section=aktuelles§ion2=amt\"><img border=\"0\" src=\"gfx/folder.gif\" width=\"16\" height=\"16\"><font color=\"#808080\">", $file, "</a>");
show_dir($dir.$file."/", $pos + 5);
}
else
{
printf ("% ".$pos."s %s\n", "<a href=\"".$dir."/".$file."\" target=\"_blank\"><img border=\"0\" src=\"gfx/pdf.gif\" width=\"16\" height=\"16\"><font color=\"#808080\">", $file, "</a>");
}
}
@closedir($handle);
if($pos == 2)
{
echo "</pre>";
}
}
show_dir("pdf/Amtsblatt/");
echo " </td>\n";
echo " </tr>\n";
echo " </table>\n";
?>
MfG Basti87
Kommentar