Try... <? //$dirname should contain the directory name including it's full path... $handle=opendir($dirname); while ($file = readdir($handle)){ echo("$file is located in the $dirname directory"); } ?>
HTH, Dw. Sqlcoders.com Dynamic data driven web solutions ----- Original Message ----- From: "Steven Mallett" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: June 08 2002 07:23 AM Subject: [PHP] Reading from a dir. > Is there another way to read the files from a directory? > > I tried the following: > > foreach (glob("*.txt") as $filename) { > echo "$filename size " . filesize($filename) . "\n"; > } > > but get an error whether safe mode is on or off. > > I'm just learning as you might guess. > > -- > Steve Mallett http://OSDir.com - Stable, Open Source Apps > [EMAIL PROTECTED] | [EMAIL PROTECTED] > http://open5ource.net <personal> | With new, all powerful, blogging > action! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php