On Wed, 18 Apr 2001 15:53, Morten Winkler Jørgensen wrote:
> Hi php'ers
>
> Executing the following code on my Redhat 7.2 box, through Apache i
> get the most annoying output:
>
> Code:
>
> function listDirectory($basedir){
>   $diary_directory = opendir($basedir);
>     while($filename = readdir($diary_directory)) {
>       if(strcmp(".", $filename) != 0) {

Here you need to prefix the full path ($basedir ?) to $filename, else the 
script will try to find the file in the current working directory.


>         if(strcmp("..", $filename) != 0) {
>           print("<br>$filename is \"");
>           print filetype($filename)."\"";
>         }
>       }
>     }
>   closedir($diary_directory);
> }
> listDirectory(".");
>
> Output (sample):
>        index.php is ""                  (should be "file")
>        Ansatte is ""                    (should be "dir")
>        Produkter is ""                  (should be "dir")
>        Kontorer is "dir"
>        view.php3 is ""                  (should be "file")
>
>
> What could possibly be the error?
>
>
> Kind regards,
>     Morten Winkler

-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to