RE: [PHP] Newbie question: need to transfer directory contents fr om my local machine to my website Posted by Jim Moseby on 12/06/35 11:36 > > > > You will not be able to do what you propose with a purely > PHP solution. PHP > > is a server-side technology. That means all the processing > is done at the > > server, then output to your browser. PHP, to my knowledge, > has no way to > > inspect your computer's folders. You would need to look to > a client-side > > er??? stick the following in a file (localfiles.php): > > > function readDirWin($dir) { >$d = dir($dir); > while (false !== ($entry = $d->read())) { > if($entry!="." && $entry!="..") { > echo ($entry = $dir."\\".$entry), "\n"; > if(is_dir($entry)) { > readDirWin($entry); > } > } > } > \$d->close(); > } > var_dump( readDirWin("C:") ); > > ?> > > and call it like so: > C:\path\to\your\CLI\php.exe C:\path\to\your\localfiles.php Perhaps I misunderstand what the OP wanted. I thought he was running a webserver somewhere, and that he wanted his remote webserver to be able to grab a file listing on his local machine by just visiting a webpage there. Of course PHP can query the local filesystem. I thought he wanted it to query a remote filesystem. JM   Navigation: