r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!RebGUI] A lightweight alternative to VID

Ashley
1-Jan-2012
[8971]
Didn't require one in the past, server config has probably changed.
MaxV
4-Jan-2012
[8972x3]
You can create the following file index.html:
<?php
  function getDirectoryList ($directory) 
  {
    // create an array to hold directory list
    $results = array();
    // create a handler for the directory
    $handler = opendir($directory);
    // open directory and walk through the filenames
    while ($file = readdir($handler)) {

      // if file isn't this directory or its parent, add it to the results
      if ($file != "." && $file != "..") {
        $results[] = $file;
      }
    }
    // tidy up: close the handler
    closedir($handler);
    // done!
    return $results;
  }
?>
Or better:
<?

$path = ".";
$dir_handle = @opendir($path) or die("Error opening $path");
echo "Directory content: <br/>";
while ($file = readdir($dir_handle))
{
if($file!="." && $file!="..")
echo "<a href='$file'>$file</a><br/>";
}
closedir($dir_handle);
?>
Gabriele
5-Jan-2012
[8975]
Or just enable Indexes in apache.
Ashley
6-Jan-2012
[8976]
... if you have control over that ;)
Gabriele
6-Jan-2012
[8977:last]
most of the times, you can put that in a .htaccess file.