Log in

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



kitson
03-09-2012, 01:58 AM
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)

jscheuer1
03-09-2012, 03:41 AM
There are tons of these around, here's one:

http://css-tricks.com/snippets/php/display-styled-directory-contents/

We modified it to make it better here:

http://www.dynamicdrive.com/forums/showthread.php?t=67518

But as I say there're tons of these things around. Google:

PHP code for folder contents

for more choices.

kitson
03-13-2012, 08:02 AM
Thanks, John!
Very useful information. I 'll learn it harder.