acess to remote directory (archive listings from remote )

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cris
Forum Newbie
Posts: 1
Joined: Tue Nov 28, 2006 5:15 am

acess to remote directory (archive listings from remote )

Post by cris »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


hi !
i am a starter with PHP and i d very grateful if someone of you could give me a hand please. 

i have the following code for a local directory :

Code: Select all

<?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>';
?>
i want to acces a remote directory with the follwing link (s. also above ) http://www.doncasa.com/fotos/BA1528
how do i ahve to do this ? on the PHP i didnt view anything specified .......

thanks for your help
greetings from barcelona, spain
Christian


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

file_get_contents() is typically all that's required for simple stuff. cURL and/or a library such as Snoopy for more complex requests.
Post Reply