Announcement

Collapse
No announcement yet.

Webhosting - public folders?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Webhosting - public folders?

    hey all, bought myself a lovely domain (best ?6 i ever spent), and sometimes i've stumbled across websites where i can access a folder within the site that just has a directory listing with files.

    what i wanna do is have a folder that just shows a bunch of jpegs that people can click (saves me sending over msn or uploading to photobucket then sending a link, etc etc). like i said i've seen them before, and i want to achieve a similar thing myself.

    atm i'm using a folder in my dad's webspace (he's with streamline.net) and his provider doesn't let you do virtual folder listings.

    is this generally across the board, or are there hosts that let you display the folder to the public, or could it just require some sort of config file somewhere?

    thanks for any replies
    Last edited by randombs; 24-06-2007, 12:14.

    #2
    If your server does PHP I could give you a simple directory listing script.

    Comment


      #3
      i think it does, it's my dad's space and i haven't really checked the features. would it just be a php file? i guess i could try it and then i'd know!

      thanks mate

      Comment


        #4
        Code:
        <?php
        foreach (glob("*.*") as $filename) {
        echo "<a href='$filename'>$filename</a><br>";
        }
        ?>
        This one will show everything in the base folder.

        Code:
        <?php
        foreach (glob("*.gif") as $filename) {
        echo "<a href='$filename'>$filename</a><br>";
        }
        ?>
        You can alter it to show for example, JUST gif images.

        There are more advanced ones, this is the most simple one I use sometimes.

        Comment


          #5
          cheers for that code. what would i save it as? (i know bugger-all about php)

          EDIT

          it's ok i did it

          i saved it as index.php and it's working! thanks alot!

          Comment

          Working...
          X