Posted by:
nateharper
(---.cable.mindspring.com)
I am trying to scan a directory on my site, at [
127.0.0.1]. the code in the file is
<?php
$dir = 'http://127.0.0.1/scan/1';
$files1 = scandir($dir);
$files2 = scandir($dir, 1);
print_r($files1);
echo "<br><br>";
print_r($files2);
?>
the folder '1' has a few pictures in it and not much else. when i do $dir = '1', then it works. the php web site says that you need to enable fopen wrappers in phpini so i did.
;;;;;;;;;;;;;;;;;
; Fopen wrappers ;
;;;;;;;;;;;;;;;;;;
; Whether to allow the treatment of URLs (like http:// or [
]) as files.
allow_url_fopen = On
; Define the anonymous ftp password (your email address)
;from="john@doe.com"
and saved and restarted apache.
when i open the file with the first code it spits out a bunch of error messages:
Warning: scandir(http://127.0.0.1/scan/1) [function.scandir]: failed to open dir: not implemented in E:\wamp\www\scan\index.php on line 3
Warning: scandir() [function.scandir]: (errno 0): No error in E:\wamp\www\scan\index.php on line 3
Warning: scandir(http://127.0.0.1/scan/1) [function.scandir]: failed to open dir: not implemented in E:\wamp\www\scan\index.php on line 4
Warning: scandir() [function.scandir]: (errno 0): No error in E:\wamp\www\scan\index.php on line 4
can someone help me?
-thanks for you help.