enkay
08-11-2008, 04:56 AM
I would like to list a directory that's on another website I own.
I can set any kind of permission and the directory I want to list currently has no index file and displays an apache directory list when opened directly.
I would like to keep it as simple as possible otherwise I'll just use a database.
I read something about using an include file but I'm not sure about how that would work. Any clue?
I think you can also use ftp, but once again I'm not sure how to go about this. Also I read this slows down the process, I don't know if it's true.
http://us.php.net/function.opendir
I would like to use opendir. According to the manual "path supports the ftp:// URL wrapper" and also "path can also be any URL which supports directory listing, however only the file:// URL wrapper supports this in PHP 4". I'm not sure if that's of any help for me. I use PHP 5.something.
What's the difference with fopen? I read that fopen would work on remote directories but opendir wouldn't.
Bottom line is: can anyone shed some light one how I could list files from a remote directory?
As long as I get this task done, any way is fine but the simpler the better. Otherwise, I might aswell just use a database which is what I'm trying to avoid right now.
Thanks.
I can set any kind of permission and the directory I want to list currently has no index file and displays an apache directory list when opened directly.
I would like to keep it as simple as possible otherwise I'll just use a database.
I read something about using an include file but I'm not sure about how that would work. Any clue?
I think you can also use ftp, but once again I'm not sure how to go about this. Also I read this slows down the process, I don't know if it's true.
http://us.php.net/function.opendir
I would like to use opendir. According to the manual "path supports the ftp:// URL wrapper" and also "path can also be any URL which supports directory listing, however only the file:// URL wrapper supports this in PHP 4". I'm not sure if that's of any help for me. I use PHP 5.something.
What's the difference with fopen? I read that fopen would work on remote directories but opendir wouldn't.
Bottom line is: can anyone shed some light one how I could list files from a remote directory?
As long as I get this task done, any way is fine but the simpler the better. Otherwise, I might aswell just use a database which is what I'm trying to avoid right now.
Thanks.