Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using PHP to access remote directories

Status
Not open for further replies.

tomhollis

Technical User
Joined
Feb 18, 2004
Messages
2
Location
GB
I am not sure this is possible with PHP being a server based language, however if anyone can tell me how to do it or point me in the right direction it would be much appreciated.

I am writing a picture gallery page which takes a folder as an external variable and displays all pictures in that folder. Is it possible to give a URL as a folder? If I try this I get a 'false' returned from the is_dir() function which I do not get with a local folder.

Thanks for any help

Tom
 
is_dir() will only work in your local filesystem - local in the sense of the server.

You can make connections to other servers via http and list folder contents, retrieve images etc. Read up on cURL or the PHP socket connections ( and
 
Thanks for the tip!

I think I am going to give it a try using opendir(path) rather than dir(path) as I was doing as the former is supposed to be abe to use URLs, opendir() can be used instead of is_dir() as well

Cheers

Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top