Results 1 to 2 of 2

Thread: php question

  1. #1
    Join Date
    Mar 2003
    Duluth MN

    php question

    Ok, I'm looking through my PHP books and online but I can't seem to find how to do this:

    I want to get a list of all the files/folders in the same directory that the php file is in.

    What I am trying to do is create an index.php file that I can throw into my folders that contain misc items to format all the files in the folder, rather than using apaches default directory view. I want it to generate the list, link to the items (for download) and do it dynamically because I don't want to modify the file for every single folder I have and every time I add/remove a file.

    Is this possible?

  2. #2
    Hi amish_geek,

    Maybe I'm not understanding your question, anyway this code here reads all the files from $directory.

    while ($file = readdir($handle)) {
    //do anything

    Let me know if this solves your problem.


Posting Permissions

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