Einzelnen Beitrag anzeigen
  #1  
Alt 26.05.2003, 19:56:48
UGK UGK ist offline
Anfänger
 
Registriert seit: May 2003
Beiträge: 1
UGK eine Nachricht über ICQ schicken
was mach ich falsch ???

HI ich mach grad so für mich ne art filebrowser was ja ansich nciht schwer sein müßte aber irgendwas stimmt an meinem code nicht sobald ich in einem unterordner bin sieht er jede datei als "ordner" so wie ich mich kenne is der fehler wahrscheinlich ganz simpel hier der code :

Code:
<table  width="50%" align="center">
<?php

echo "<b>Stammverzeichniss/$_REQUEST[path]</b>";

if (!$_REQUEST["path"]){

$handle = opendir('.');
while (false !== ($file = readdir($handle))) {
    if (is_dir ($file)) {
        if ($file != "." && $file != "..") {
        echo "<tr><td><a href=./index.php?path=$file>$file</a></td></tr>n";
            }
        }

    if (is_file ($file)){
        if ($file != "." && $file != ".." && $file != "index.php" && $file != "~scp.php" && $file != "~out.htm") {
            echo "<tr><td><a href=./$file>$file</a>n</td></tr>";
                }
        }
    }
closedir($handle);
}


if ($_REQUEST["path"]){

$handle = opendir($_REQUEST["path"]);
while (false !== ($file = readdir($handle))) {
    if (is_dir ($_REQUEST["path"]/$file)) {
        if ($file != "." && $file != "..") {
        echo "<tr><td><a href=./index.php?path=$_REQUEST[path]/$file>$file</a></td></tr>n";
            }
        }

    if (is_file ($_REQUEST["path"]/$file)){
        if ($file != "." && $file != ".." && $file != "index.php" && $file != "~scp.php" && $file != "~out.htm") {
            echo "<tr><td><a href=./$file>$file</a>n</td></tr>";
                }
        }
    }
closedir($handle);
}



?>

</table>
das script liegt auf meinen homeserver also nicht wundern wenns etwas langsamer ist ....

http://217.224.235.74/a/index.php

THX
Mit Zitat antworten