Well, you should be getting an error like this:
Warning: readdir(): supplied argument is not a valid Directory resource...
However, if you attempt to read "/," it will read your C: drive. This happens naturally on Apache. Try something like this:
$handle = $_SERVER["DOCUMENT_ROOT"]."/";
$handle = opendir($handle);
while ($file = readdir($handle)) {
echo($file."<br>\n");
}
closedir($handle);
Also, your code seems to run pretty slow, try rewriting it the method that I just showed.