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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.