Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Oct 2002
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    page to list all of the files in the directory?

    hi, i'm using Orange WebServer (hxxp://www.orangesoftware.net/orangewebserver.html) to host my website. but i want to make a webpage to just list all of the files and folders in the directory...kinda like an ftp site (so like when i move and delete stuff around in the directory the page automatically updates the links and folders). is there any way to do this and is there like a template i can download to play around with?

    thanks,
    mike

  • #2
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Your host have a serverside language supported (php, asp, cgi..)? If it doesn't, I don't think you can do it.

  • #3
    New Coder
    Join Date
    Oct 2002
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i think it does support CGI and PHP

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Posts
    166
    Thanks
    0
    Thanked 0 Times in 0 Posts
    With my isp anyhow...

    I uploaded a page with a dummy link
    <a href="">Anything here</a>

    and clicking on the link brings on all the files within that directory. Works with IE5.5 and NN4.7 (not NN7).

  • #5
    New Coder
    Join Date
    Oct 2002
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it does support asp. does anyone know of any asp scripts that will do this?
    Last edited by m7d7g7; 10-09-2002 at 01:18 AM.

  • #6
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Maybe something like this?

    http://www.asp101.com/samples/dir_list_sort.asp

    (stuff in the green table). I don't know ASP but I'm sure you could delete everything from there and just show the page as a real directory page.

  • #7
    New Coder
    Join Date
    Oct 2002
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    looks like it would work perfect...lets see if i can get it to work.

  • #8
    mat
    mat is offline
    Regular Coder
    Join Date
    Jul 2002
    Posts
    199
    Thanks
    0
    Thanked 0 Times in 0 Posts
    so it just supports asp? or php as well?

    if it supports php, crack open notepad or your txt editor of choice and type the following in:

    <?php
    if ($handle = opendir('.')) {
    while (false !== ($file = readdir($handle))) {
    if ($file != "." && $file != "..") {
    echo "<a href='$file'>$file</a><br>";
    }
    }
    closedir($handle);
    }
    ?>


    save it as 'index.php' (or whatever you like) and upload.

    or d/l the attached readymade one.


    mat,
    Attached Files Attached Files
    Last edited by mat; 10-09-2002 at 09:25 PM.

  • #9
    New Coder
    Join Date
    Oct 2002
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks mat, i downloaded the script and when i tested it this is what came out (http://windowstips.homestead.com/files/Image1.jpg) i'm pretty sure that the server supports php. do i have to configure anything?

  • #10
    New Coder
    Join Date
    Oct 2002
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts
    whoops...it's my fault. Orange Web Server doesnot support php...but i found a diffrent one that does and it works great!

    thanks for everyone's help!
    mike


  •  

    Posting Permissions

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