acces to remote directory ?

Discussion in 'PHP' started by erino, Nov 28, 2006.

  1. #1
    hi,

    i have a question regarding the creation of directories in PHP.
    i want to create an acces to an external /remote directory so that on the page it displays the contents. Ia have below the code of the local
    one, so does anyone know how to call a an external directory.


    thanks a lot for your help
    here comes the code

    <?php
    echo '<h1>Index of /adult/</h1>';
    echo '<ul>';
    echo '<li><a href="http://www.doncasa.com/fotos/BA1528
    "> Parent Directory</a></li>';

    $dir = scandir('.');
    $files = count( $dir );
    for ( $i = 0; $i < $files; $i++ )
    {
    if ( is_file($dir[$i]) && strlen( $dir[$i] ) <= 36 && ( strstr( strtolower( $dir[$i] ), '.htm' ) || strstr( strtolower( $dir[$i] ), '.html' ) || strstr( strtolower( $dir[$i] ), '.php' ) ) )
    echo "<li><a href=\"$dir[$i]\">$dir[$i]</a></li><br>";

    if ( is_dir($dir[$i]) && $dir[$i] != "." && $dir[$i] != ".." && $dir[$i] != "adult" )
    echo "<li><a href=\"$dir[$i]\"/>$dir[$i]/</a></li><br>";

    }

    echo '</ul>';
    ?>

    regards from barcelona
    chris
     
    erino, Nov 28, 2006 IP
  2. penagate

    penagate Guest

    Messages:
    277
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I'm a little confused.

    You can't scan directories on a remote server, if that's what you mean.
     
    penagate, Nov 28, 2006 IP
  3. erino

    erino Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hi,

    thanks for the answer , but what I mean is to display a remote directory
    in my local database , i am sorry for the confusing expresion......anyway I was thinking that maybe its a
    bit iddifuclt if not impossible...thanks in adavance for any answers :)

    regards
    chris
     
    erino, Nov 29, 2006 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    nico_swd, Nov 29, 2006 IP