Jump to content

Archived

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

akrytus

Directory Listing

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!

Share this post


Link to post
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>

Share this post


Link to post
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?

Share this post


Link to post
Share on other sites

×

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.