Reply
Automatic collapsible menu??
Old 03-11-2010, 11:19 AM Automatic collapsible menu??
Junior Talker

Posts: 2
Name: Carol Helmich
Trades: 0
I don't know if this is possible but before I went to a lot of work I thought I would ask, and this may not be the correct forum in which to ask but I had to start somewhere.

On the website I built and am now managing I have a folder called "Documents". Inside that folder are other folders, and inside those folders are actual documents.

I would like to create a page called "Document Center" that the visitor can go to to find a certain document, say an application.

I like the idea of a collapsible menu so the visitor isn't hit with a huge long list of documents to sort thru, however, it seems like it will be a pain to maintain since every time I upload a document, I then have to go and update the menu.

Is there anything out there that I can use that will "automatically" see and list what is in that folder? Similar to Windows Explorer. I don't have to tell my computer each time a file is added, if I go to Explorer and click on the folder it shows me everything in there.

Does this make sense? BTW, I am a newbie at this so take it easy on me please!
chelmich is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 03-11-2010, 11:34 AM Re: Automatic collapsible menu??
wayfarer07's Avatar
Eat You

Posts: 3,570
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
To read files on the server, you need a server side code, such as ASP, Coldfusion, PHP, etc. Reading a list of all files in a directory is a trivial task with one of these, with a small amount of programming, but there are no facilities in the browser to manage this task.
__________________
Wayfarer | bBoard
If Google is the Coca-Cola of Web search, Bing is RC Cola
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 03-11-2010, 04:16 PM Re: Automatic collapsible menu??
Junior Talker

Posts: 2
Name: Carol Helmich
Trades: 0
I know the server supports PHP but I am not fluent in it.
If I was going to do a search to find a tutorial on this, what should I search for? I haven't had any luck so far.
chelmich is offline
Reply With Quote
View Public Profile
 
Old 03-11-2010, 07:22 PM Re: Automatic collapsible menu??
wayfarer07's Avatar
Eat You

Posts: 3,570
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
In PHP it works like this:
PHP Code:
$dh opendir('/absolute/path/to/');
while ((
$file readdir($dh)) !== false) {
    if(
filetype('/absolute/path/to/' $file) == 'file') {
        echo 
$file;
    }
}
closedir($dh); 
The line:
Quote:
echo $file
simply means output the file name to the browser, without the path info. Of course you could do may other things, such as:
PHP Code:
echo '<a href="/directory/' $file.'">'.$file.'</a>'
Of course, none of this is directly related to a collapsible menu, which is more a JavaScript issue, but since PHP processing happens before any code hits the browser, it is a separate task entirely.
__________________
Wayfarer | bBoard
If Google is the Coca-Cola of Web search, Bing is RC Cola
wayfarer07 is online now
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Reply     « Reply to Automatic collapsible menu??
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.09836 seconds with 13 queries