+ Reply to Thread
Results 1 to 2 of 2

List Folder Contents

This is a discussion on List Folder Contents within the PHP, ASP, JavaScript, Etc. / Programmers: forums, part of the Web Project Requests: category; You know with PHP and MySQL, you can list a load of data. Well, is it possible to do it ...

  1. #1
    New Hunter Smiggy will become famous soon enough Smiggy will become famous soon enough
    Join Date
    Dec 2007
    Posts
    17

    Default List Folder Contents

    You know with PHP and MySQL, you can list a load of data. Well, is it possible to do it with just PHP and a folder.
    I need to list the items from a folder basicly, should I make a Database and store the data there?

  2. #2
    Field Master sunken is on a distinguished road sunken's Avatar
    Join Date
    Sep 2007
    Posts
    204

    Default

    There are commands to read a directory in PHP...

    $dirname='/home/dir-to-read';

    if ($handle = opendir($dirname)) {
    while (false !== ($filename = readdir($handle))) {
    echo($filename."\n");
    }
    closedir($handle);
    }

    Would load and print a list on the page. Of course you'd probably want to do some formatting rather than just an echo. You can put whatever code you want there.
    Last edited by sunken; 04-03-2008 at 09:47 PM.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts