PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I then echo $dirTree but nothing displays, the list doesn't even show up in the source html.
What I'm trying to do is make an unordered list of directories. I want a new unordered list for every directory within a directory. It should results with a nice indented list of directories within directories within directories etc.
Please help me with this one I hope it's not too complicated.
Warning: opendir(/home/content/t/r/a/tradingtresure/html//././././././././././././././././././././././././. in /home/content/t/r/a/tradingtresure/html/manager/files.php on line 6
Warning: readdir(): supplied argument is not a valid Directory resource in /home/content/t/r/a/tradingtresure/html/manager/files.php on line 7
Warning: is_dir(): Stat failed for /home/content/t/r/a/tradingtresure/html//././././././././././././././././././././././././././././././././././././ in /home/content/t/r/a/tradingtresure/html/manager/files.php on line 9
The third error keeps repeating till I stop the page.
Does anyone have a good way of displaying a list of directories with php?
You aren't detecting the two special directories "." and ".." therefore you get stuck in an infinite loop on "." as it points to the current directory.
This has been many times before on these boards. Have you searched here yet? Also, there is a function in php 5 called scandir() that you might be able to tap into (or at the very least there are comments on that page that will do exactly what you are trying to do).