Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default Getting the files?

    How can i make a php page that when in a certain directory, would display all the other files in that directory?
    Any help would be really appreciated and rep given
    Joe
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  2. #2
    Join Date
    Jan 2007
    Location
    West Yorkshire
    Posts
    384
    Tokens
    0

    Default

    PHP Code:
    <?php

    $path 
    "path/to/folder";

    $dir = @opendir($path) or die("Can't open $path");

    while (
    $item readdir($dir)){
    echo 
    "<a href='$item'>$item</a><br>";
    }

    closedir($dir);

    ?>

    “two players, two sides.
    one is light, one is dark.”
    - John Locke

  3. #3
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Ah, i didn't know you could do that with PHP. A prime example that no matter how good at PHP you are, you can always learn more.Thanks ZAG +REP
    James


    Connected to reality through a proxy server.

Posting Permissions

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