Jump to content

Directory Listing


akrytus

Recommended Posts

Perhaps I expect to much, but is it possible to create a webpage that works like an index?  List all the directories and files and be able to click on a directory to browse it and to click on a file to download it while all being held in a scroll box within the page to keep the page from having to scroll?  Any sample code or ideas would be appreciated.  Thanks!
Link to comment
https://forums.phpfreaks.com/topic/17007-directory-listing/
Share on other sites

indeed you can do this - its not too difficult...

you will need to know opendir(), readdir(), closedir().

loop through the directory using read_dir() if its a directory then gen a link to run script again with the new directory the root folder its looking in, if a file generate a link to download/view.

as far as the html goes...

<div style="height: 400px; over-flow: auto;">
//stick you links in here...
</div>
Link to comment
https://forums.phpfreaks.com/topic/17007-directory-listing/#findComment-71812
Share on other sites

Sounds good, but how do you create a script that would run on a mouse click to change the dir.  I would naturally try to have the php chr_dir command run on a java onClick but, I have found the php will run immediately without the java script running first.  Do you have an idea how I can get the script to run on the click, without using a form?
Link to comment
https://forums.phpfreaks.com/topic/17007-directory-listing/#findComment-71826
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.