I just need a general idea of how to get a full directory listing of files on my server and a text field that will display what file I want in plain text that I can click save changes and it updates the page.

Pretty much need to know how to get a listing of files, the rest I think I can hande.

Thanks!

    No one knows. Blasts. Time to do more research...

    🙁

      7 months later

      <?php
      // absolute path can be set by ?path = in browser window
      $absolute_path = "path to files";

      // set link properties
      $dl = $absolute_path . "viewcode.php?path=&file=";

      read the directory
      $dir = opendir($absolute_path);

      while ($file = readdir($dir))

      {

      // if the file is text list it all other files ignore
      if (($file != "..") && ($file != ".") && !strstr($file, '.txt'))

      {

      //convert the filename to having no extension (optional)
      $filename = eregi_replace('.[a-z]+$','',$file);

      $list .= "<a href='$dl$file'>$filename</a><br>";

      }

      }

      // this lists the files and redircts them to your editpage
      echo $list;

      ?>

      to set the $path for multilevel opening

      <?php
      if (isset($GET['path'])){
      $path = $
      GET['path'] ;
      }
      else {
      $path = "absolute path to default directory";
      }
      ?>

      Have Fun🆒

        Write a Reply...