Hi All;

How to write a PHP coding to list out all files and directories as links to them?

This is somewhat similar to some index pages. When new file or folder is added to the directory, HTML page should display the newly created file/folder together with previous ones after it is being refreshed. (prefer in alphabatical order)

How to achieve this sort of functionality in PHP? Please provide sample coding as well. (and any references)


commented: please show some effort rather than expecting others to do all the work for you -2
Member Avatar

This is certainly possible. You can even use Ajax so that changes are made on the fly if you're the one doing the changes. However, ajax won't work if a number of people make changes - that'll only happen if you set js to check structure every 20 seconds or so with a timer. That can get messy, especially if you're using an interactive tree. You could have a message box refreshed every 20 seconds though to tell you what files/folders are being changed/created/deleted/renamed. Anyway, that's something else.

Just a question. When you want links to the files, that makes sense. But links to folders? Does that mean that when you click a folder the page refreshes and you see the contents (links) of that?

So are you looking for a tree-type script?


@smant - now I re-read his post, I it's a 'gimme'.

> Please provide sample coding as well. (and any references)

OK, do YOUR research and come back when you're stuck.