01.
<?php
02.
$path
=
'\\networkdrive\somepath\your_directory'
;
03.
04.
$user
=
"username"
;
05.
$pass
=
"password"
;
06.
$drive_letter
=
"Q"
;
07.
08.
system(
"net use "
.
$drive_letter
.
": \""
.
$path
.
"\" "
.
$pass
.
" /user:"
.
$user
.
" /persistent:no>nul 2>&1"
);
09.
$location
=
$drive_letter
.
":/somepath/your_directory"
;
10.
11.
if
(
$handle
= opendir(
$location
)) {
12.
while
(false !== (
$entry
= readdir(
$handle
))) {
13.
echo
"$entry"
;
14.
}
15.
closedir
(
$handle
);
16.
}
17.
?>