Has anyone ever used the open directory function to open a directory on another server, other than the one you are currently working on??? If so, please point me in the right direction.
From the example below, I would like $sPath to point to a folder on another server but I can't get it to work.
Thanks,
Jamie
/ Path to the upload folder. /
$sPath= "another_server/folder_on_that_server/";
/ Open directory and get an array of file names. /
$file_array = array();
function GetDirArray($sPath)
{
global $file_array;
$handle=opendir($sPath);
$i=0;
while (false!==($file = readdir($handle)))
{
/ We do not want to display certain information, such as this file and the help file. /
if ($file != "." && $file != ".." && $file != "maintain_files.php" && $file != "info.htm" && $file != "enter_user.php")
{
$file_array[]= $file;
$i++;
}
}
closedir($handle);
sort($file_array);
}
$sPath= "another_server/folder_on_that_server/";
GetDirArray($sPath);