I found the below snippet on the Web. It lists the contents of a given directory. My problem is, regardless of permissions, that it works on '/', '/home/' even my personal home dir '/home/axion/'...but not on '/media/' or what I really need to list is '/media/extra/'. Actually it only works on / and /home/* but nothing else. What could the problem be? i even tried "chmod -R 777 /media"...permissions do not seem to matter...it seems as if it's a built-in PHP security feature that I can't figure out how to turn off. Any help would be appreciated...thanks! 🙂
<?php
$dir = "/media/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo($file . "<br>");
}
closedir($dh);
}
}
?>