开发者

php opendir(different domain folder) - Is this possible to achieve?

I'm trying to manage away of knowing witch images are inside the predefined p开发者_如何学Pythonics folder on my domains.

I'm trying with opendir, but it always fails, even if I'm sure my folder is there, so I guess the problem is the crossdomain thing.

Having ftp credentials, is there a way of let php know that I can indeed read the content of my folders?


You must the ftp_ series of functions to achieve what you're describing.

For example:

$ftp = ftp_connect($server);
ftp_login($ftp, $username, $password);
ftp_chdir($ftp, $images_dir);

$files = ftp_nlist($ftp); // Array of files in the images folder
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜