megamazl
Goto Top

Opendir im Netzwerk

Hallo Administrator-Gemeinde,

ist es möglich mit PHP den Inhalt eines Netzwerkordners anzuzeigen?
Mein Code sieht bisher so aus:

<html>
<head>
<title>Unbenanntes Dokument</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">  
</head>
<body>
<?php
if ($handle = opendir('//192.168.1.2/d/watchin')) {  
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {  
            echo "$file\n";  
			echo "</br>";  
        }
    }
    closedir($handle);
}
?>
</body>
</html>

Der Ordner ist natürlich freigegeben.

Danke im voraus.

Content-Key: 99731

Url: https://administrator.de/contentid/99731

Printed on: May 8, 2024 at 11:05 o'clock

Member: vbMaxi
vbMaxi Oct 20, 2008 at 11:34:34 (UTC)
Goto Top
Hi,
habs net ausprobiert, aber wie siehts aus, wenn du jedes "/" in "\" um wandest?
\\192.168.1.2\d\watchin
Member: megamazl
megamazl Oct 20, 2008 at 11:48:25 (UTC)
Goto Top
geht leider auch nicht. Ich hab vergessen zu sagen, dass PHP lokal auf einem virtuellem Server läauft.
Member: vbMaxi
vbMaxi Oct 20, 2008 at 20:10:36 (UTC)
Goto Top
Kleene Frage,
läuft des auf nem IIS oder nem Apache???

Falls du den IIS verwendest musst du den Letzten Post beachten:
http://www.webmasterworld.com/forum88/3375.htm


mfg Maxi
Member: megamazl
megamazl Oct 20, 2008 at 20:21:51 (UTC)
Goto Top
habs schon, es muß heißen
if ($handle = opendir('////192.168.1.2/d/watchin')) {   

also mit 4 /

trotzdem danke