I'm kinda new to PHP.
I've got two different hosts and I want my php page in one of them to show me a directory listing of the other. I know how to work with opendir() on the same host but is it possible to use it to get access to another machine?
Thanks in advance
Try:
<?php
$dir = opendir('ftp://user:[email protected]/path/to/dir/');
while (($file = readdir($dir)) !== false) {
if ($file[0] != ".") $str .= "\t<li>$file</li>\n";
}
closedir($dir);
echo "<ul>\n$str</ul>";