1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Development Website[Dir Listing]

Discussion in 'Software' started by Dash, 1 Feb 2003.

  1. Dash

    Dash What's a Dremel?

    Joined:
    24 Sep 2002
    Posts:
    217
    Likes Received:
    0
    Ok I have a prob becuase I am lost at this.
    My old website was used as a image dump and everytime I uploaded something it would make a listing of the files in that folder on the web....Example http://home.satx.rr.com/dash075/image/

    Now I bought paid hosting becuase I needed more space for more pictures and I liked having that dir listing show up becuase it made life easier for me especially not have to type in each picture and just having to click on a link. But I don't know how to recreate that since on my new host it does this http://www.thevisions.com/error_docs/forbidden.html
    Is there anything I can do to get that parent directory listing to show up in certain folders and sorry if this is a n00bie question but this is my first time at this :(


    Thank you for any help you can provide :p
     
    Last edited: 3 Feb 2003
  2. sheepgoat

    sheepgoat What's a Dremel?

    Joined:
    8 Nov 2001
    Posts:
    48
    Likes Received:
    0
    depends on the server. if you have a .htaccess file then that's what's causing it. i'm just learning about using those files so i'm not sure what you have to do, but i'm sure that google would know. if you don't have access to it you can get a script that will display all the contents of the folder as links to the individual files.

    here's the part where someone else proves the other option, which is that i be completely wrong. :D
     
  3. linear

    linear Minimodder

    Joined:
    5 Oct 2001
    Posts:
    4,393
    Likes Received:
    1
    If your host has allowed you to override index configuration in a .htaccess file (assuming apache, but 99% of cheap paid hosting probably is), then you need to put this line in a file called .htaccess in your directory:
    Code:
    FancyIndexing on
    If overrides aren't allowed, you need a script that will do it for you, such as this PHP script I use:
    Code:
    All images © 2001-2003 Rob 'linear' Arnold. All rights reserved.
    <BR><BR>
    <?php
    
    // directory setup
    $basedir = "/home/linear1";
    $imgdir = "/i";
    
    
    // prepare to scan....
    $scandir = opendir($basedir . $imgdir);
    while ($entry = readdir($scandir)) {
      if (!strcmp($entry,".")) { continue; }
      if (!strcmp($entry,"..")) { continue; }
      if (!strcmp($entry,"index.php")) { continue; }
      $size = getimagesize($entry);
      echo "<IMG src=\"$imgdir/$entry\" $size[3] border=\"0\" alt=\"$imgdir/$entry\"> \n";
    
    }
    closedir($scandir);
    ?>
     
    My script actually shows them, but you could easily alter it to make links to the images instead. Just change the echo statement.
     
  4. Dash

    Dash What's a Dremel?

    Joined:
    24 Sep 2002
    Posts:
    217
    Likes Received:
    0
    wh00t it worked ...thanks for all the help guys :clap:
     

Share This Page