ummm, I was wondering if it was possible, and if so how, could use php to automatically list all the files AND subdirectories of a specific directory. Sorta like a php generated index.
@PhenomenaauthorSep 18.2007 — #ok sorry for double post, I guess you can't edit your posts here >_<
Anyways I did some looking around and I found about the readdir() function so now I have a page that lists all the directories, and creates a link to them, but instead of having to create a seperate page for each sub directory to read the files how owuld I go about setting it up so it was like...
www.mysite.com/files.php?pictures
when you clicked the picture link generated by the readdir()
@rootSep 18.2007 — #IF its any help, this is what I used in a small routine to get the listing of a directory for a web page that I then later expanded to filter by type of file but the core listing of a directroy is this[code=php]<?php $ver = phpversion(); if( ($v=substr($ver,0,strpos($ver, '.',1)))=="4" ){ // php4 $directory_current = getcwd(); $files_in_current = array(); // read the local directory $d = dir($directory_current); while (false !== ($entry = $d->read())){ array_push($files_in_current,$entry); } $d->close(); }else{//use php 5 // get current directory $directory_current = getcwd(); // get the files in that current directory $files_in_current = scandir($directory_current); }[/code]