scandir on HTTP

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

my php script :
scandir(" /", 0);
doesn't return any file.
The php file is not executed from , 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 ?

Merci, Sylvain.

Re: scandir on HTTP

Sylvain Hugues ebookers wrote:
Quoted text here. Click to load it

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
Jerry Stuckle
JDS Computer Training Corp.

Re: scandir on HTTP

Sylvain Hugues ebookers escribió:
Quoted text here. Click to load it

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.

Quoted text here. Click to load it

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?

-- - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web:
-- Mi web de humor satinado:

Site Timeline