Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- scandir on HTTP
- Sylvain Hugues ebookers
July 2, 2009, 3:00 pm
rate this thread
my php script :
scandir("http://mysite.com/files /", 0);
doesn't return any file.
The php file is not executed from http://mysite.com , but from an other
I guess it comes from the fact that they re not hosted on the same
How to allow 2 servers to communicate ?
Re: scandir on HTTP
I've never tried this with a URL, but for this to work, you have to have
allow_url_fopen set to on in your php.ini file. Additionally, you would
have to configure the web server to show the directory index (which
would then make the directory open to everyone, unless you otherwise
restrict it in your apache configuration).
That's a start, anyway.
But what are you trying to do? Are both of these sites yours? Maybe
there is another way?
Remove the "x" from my email address
JDS Computer Training Corp.
July 3, 2009, 7:33 am
Re: scandir on HTTP
Although the manual claims you can use a URL in scandir(), I can't
figure out how it could work. As far as I know, there isn't any standard
to send directory listings through HTTP. Web servers that send directory
listings only generate an HTML document with links. Parsing URL doesn't
look like a bullet-proof method.
I've tried it locally and I'm getting two warnings ("failed to open dir:
not implemented" and "Bad file descriptor") and FALSE as return value.
You might be interested in writing your own HTML parsing routines but
that implies that the remote server is configured to send directory
listings. However, it looks easier to upload a PHP script to the remote
server that sends directory listings in a simple format of your choice.
What exactly are you trying to accomplish?
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com