Re: Readdir() question
| From: | Carlos Medina | Date: | Thu, 11 Sep 2008 12:52:37 +0000 |
| Subject: | Re: Readdir() question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279866@lists.php.net to get a copy of this message | ||
Ben Stones schrieb:
Hi, I'm going to make a small browser based file system for ease of small updates that I make frequently on my Website. First of all I want to loop all the files on the same directory and to tell PHP read the same directory, I think I'd need to use the magic constant I think its called, __DIR__ such as: <?php $dir=opendir(__DIR__); while($files=readdir($dir)) {if you are searching help, then here: www.php.net -> this is the right direction regards Carlosecho $files;} ?> But I get a few errors: *Warning*: opendir(__DIR__) [function.opendir]: failed to open dir: No error in *C:\wamp\www\Project1\index.php* on line *2* *Warning*: readdir(): supplied argument is not a valid Directory resource in *C:\wamp\www\Project1\index.php* on line *3 *Any help in the right direction will be appreciated! Cheers. Hi Ben,