RE: Newbie question: need to transfer directory contents fr om my local machine to my website

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > 
> > 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):
> 
> <?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

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux