You didn't close your loop;

    while ($file = readdir($dh)){
        if (strstr ($file, '.jpg')){
        $pictures[] = $file;
        }
    #vardump ($pictures[]);
    } <= here....
 ?>

instead of;

    while ($file = readdir($dh)){
        if (strstr ($file, '.jpg')){
        $pictures[] = $file;
        }
    #vardump ($pictures[]);
 ?>

alex

> -----Original Message-----
> From: Paul Furman [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 06, 2004 1:41 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] beginner question about while loops
> 
> Totally ignorant need for clarification... Should I set up a counter for
> loops $integer++ or if I'm going through something, the while function
> knows to just go through those and fills in array numbers accordingly?
> 
> Below is my project (while loop at the bottom):
> 
> I'm getting unexpected $end on line 18 but the file only has 17 lines!
> 
> <?php
>    if (isset ($_REQUEST ['IMGDIR'])){
>    $imagedir=$_REQUEST ['IMG_DIR'];
>     } else {
>    $imagedir = PUB_DIR . '/grasses';
>     #PUB_DIR coordinates my public htm location at home & school
>     }
>    if (!(chdir ($imagedir))){
>      print "invalid directory";
>      }
>    $fh=opendir($imagedir);
>    while ($file = readdir($dh)){
>        if (strstr ($file, '.jpg')){
>        $pictures[] = $file;
>        }
>    #vardump ($pictures[]);
> ?>
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


****************************************************************** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
****************************************************************** 


Reply via email to