RE: [PHP] Directory Listing Problem
| From: | Mark Olbert | Date: | Tue, 03 Oct 2000 23:10:30 +0000 |
| Subject: | RE: [PHP] Directory Listing Problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-18487@lists.php.net to get a copy of this message | ||
Are you running afoul of permission/access constraints?
- Mark
-----Original Message-----
From: Samantha Savvakis [mailto:samantha@cfs.net.au]
Sent: Tuesday, October 03, 2000 3:49 PM
To: Lawrence.Sheed@dfait-maeci.gc.ca
Cc: php-general@lists.php.net
Subject: RE: [PHP] Directory Listing Problem
Hi,
Thanks to everyone for all their advice.
It's still not reading the files in the directory. I put in the code that
Lawrence sent through. I added a printf statement in the GetDir function to
just print out the path (shown in the code below).
This is all the output I get when I call it like this:
readdir.php?dir=/usr/local/apache/htdocs/intranet/quality
**************************
Path = /usr/local/apache/htdocs/intranet/quality
Current Working Directory: /usr/local/apache/htdocs/readdir.php
**************************
This should be such a simple thing. Anyone know if this is a problem in PHP
4.0.3 dev? I might revert back to a different release of PHP4.
> <?php
>
> function GetDir ($sPath)
> {
> printf("<BR>Path = %s<BR>", $sPath);
> $handle=opendir ($sPath);
> while ($file=readdir($handle)){
> echo $file . "<br>";
> }
> }
>
> if (!isset($dir)) {
> $dir="/tmp";
> }
>
> GetDir ($dir);
>
> print "<br>Current Working Directory: " . $SCRIPT_FILENAME;
>
> ?>
Thanks,
Sam
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net