odd, I copied your code, changed the dir to "./" and it works for me
(php4.0.?, winnt)

if dir() doesn't work for you, you might need to use opendir(), readdir(),
etc

-----Original Message-----
From: Phieu Huynh [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 12, 2002 2:14 PM
To: Martin Towell; [EMAIL PROTECTED]
Subject: Re: [PHP] "the document contained no data"



Sorry, the file has ; I retype it wrong,
I did set error_reporting but no change,
but in the httpd error log file I found "exit signal segmentation fault
(11)"

Martin Towell wrote:

> is that a direct copy of your code - if it is, you're missing a ; after
> $entry=$d->read()
> but that wound have stopped the first one...
>
> to set error level to E_ALL, use:
> error_reporting(E_ALL);
>
> or set it in your php.ini file
> error_reporting = E_ALL
>
> -----Original Message-----
> From: Phieu Huynh [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 12, 2002 12:31 PM
> To: Martin Towell; [EMAIL PROTECTED]
> Subject: Re: [PHP] "the document contained no data"
>
> I don't know how to set erro level to E_ALL, can you give me some sample.
> I did try different way
>
> <?
>   $d = dir("/export/home/phuy/www/test/upload");
>   echo "Handle: ".$d->handle."<br>";
>   echo "Path: ".$d->path."<br>";
>         $entry=$d->read()
>         echo $entry ;
>   $d->close();
> ?>
>
> it is ok and the output is only a dot(.)
> if I add another read() statement then I got " ... no data"
>
> <?
>   $d = dir("/export/home/phuy/www/test/upload");
>   echo "Handle: ".$d->handle."<br>";
>   echo "Path: ".$d->path."<br>";
>         $entry=$d->read()
>         echo $entry ;
>         $entry=$d->read()
>         echo $entry ;
>   $d->close();
> ?>
>
> can anyone tell me what has read() has
> and readdir() return.
>
> Martin Towell wrote:
>
> > turn the displaying of errors on, and set the error level to E_ALL
> > I'm thinking that you've got a error somewhere that's stopping the
script
> > prematurely
> >
> > -----Original Message-----
> > From: Phieu Huynh [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, April 12, 2002 10:49 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] "the document contained no data"
> >
> > Hi,
> >     I am trying to read the files in the directory and display them .
> > but I got the message " the document contained no data "
> >
> > this is my code
> > <?
> >   $d = dir("/export/home/phuy/www/test/upload");
> >   echo "Handle: ".$d->handle."<br>";
> >   echo "Path: ".$d->path."<br>";
> >
> >   while($entry=$d->read()) {
> > echo $entry."<br>\n";
> >   }
> >   echo "<hr>";
> >   $d->close();
> > ?>
> >
> >   Can anyone tell me what should I do to correct it.
> >   I would like some help, thank in advance.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
>
>  Phieu (phil) Huynh
>  Computer System Officer
>  Monash University
>  Electrical & Computer Systems Engineering
>  Phone : +61 3 990 53469

--

 Phieu (phil) Huynh
 Computer System Officer
 Monash University
 Electrical & Computer Systems Engineering
 Phone : +61 3 990 53469



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

Reply via email to