You also seem to have an extra equals. Your loop should read: while (false != ($file=readdir($handle))){
It should come up as an error, but I'm not sure. Ben Manuel Ritsch wrote: > Hello There > > I'm new to PHP and trying to code a function that reads all teh files out of > a directory and printing out a link and the filesize, > but it seems that the filesize() function doesn't work, here's the code so > far: > > $handle = opendir ('images'); > echo "Files:<br><br>"; > while (false !== ($file = readdir ($handle))) { > if($file != "." && $file != "..") > { > $file_s = filesize($file); > echo "<a href=images/$file>$file</a> Filesize: > $file_s<br>"; > } > } > closedir($handle); > > and the output is somethingl ike this: > > Files: > button_test_04.gif Filesize: > button_test_03-down.gif Filesize: > lilextras_01.gif Filesize: > (and so on)... > > You see, there's no Filesize and I don't know why, please help me > > -- manu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php