View Single Post
Old 08-17-2005, 03:39 PM   #3 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 596
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Here's something I used for a quick equivalent of unix's find.
PHP Code:
 function scanDir2($workdir$startdir) {
  
$workdir "$startdir/$workdir";
  echo(
"<UL>\n");
  
$DIR opendir("$workdir");
  while(
$tmpname readdir($DIR)) {
  if (
preg_match('/^\.+/'$tmpname) == true) {
    
next;
   }
   elseif (
is_dir("$workdir/$tmpname")) {
     echo(
"<LI>\n"); 
     
scanDir2("$wordir$tmpname"$workdir);
     echo(
"</LI>\n");
    }
   else {
     echo(
"<LI>$tmpname</LI>\n");
   }
  }
  
closedir($DIR);
  echo(
"</UL>\n");

At the end you get a bunch of nested unordered lists. You would have to change this to selects and full paths insead of nested lists but the principle is the same.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote