You are here: RE: [PHP] Newbie question: need to transfer directory contents fr om my local machine to my website « PHP « IT news, forums, messages
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):
>
> <?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:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация