I need to reach Win server, scan shared folder and find out what is last created file name on this folder, and than copy this file to local folder. BUT main problem is smb, never used it before, and this is what i came up with, but no luck.
require_once('smbclient.php');
$latest = null;
$smbc = new smbclient ('//10.1.1.10/Share/Address Verification/', 'domain\\username', 'password');
if ($handle = opendir($smbc)) {
$latest = null;
while (($cur = readdir($handle) !== false)) {
if ($latest == null || filectime($cur) > filectime($latest)) {
$latest = $cur;
}
}
closedir($handle);
}
return $latest;
please help, returns Warning: opendir() expects parameter 1 to be string