Question subject: How to write a PHP coding to list out all files and director
Posted: Wed Feb 02, 2011 6:20 am
Joined: Fri Jan 28, 2011 1:06 pm Posts: 1 Has thanked: 0 time Have thanks: 0 time
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)
Thanks.
Last edited by Andrrew on Sat Feb 05, 2011 10:40 am, edited 1 time in total.
msi_333
Question subject: Re: How to write a PHP coding to list out all files and director
Posted: Thu Feb 03, 2011 1:45 pm
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
Code:
// open the current directory $dirconn=opendir(".");
while (($file = readdir($dirconn))!==false) { echo "$file <br>"; }
closedir($dirconn);
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
Kailee
Question subject: Re: How to write a PHP coding to list out all files and director
Posted: Mon Jun 06, 2011 11:47 am
Joined: Mon Jun 06, 2011 11:22 am Posts: 3 Has thanked: 0 time Have thanks: 0 time
I am also eager to know about it. So any body here who knows about it.