Display all images

I have a folder full of images, ad im trying to use php to display them, is this right?


<?php
$handle = opendir(dirname(realpath(__FILE__)).'/../images/dolls/'.$row['id']);
while($file = readdir($handle)){
echo '<img src="realpath(__FILE__)).'/../images/dolls/'.$file.'" border="0" />';
}
?>

Did you run it and test if it works?

I dont see the images
http://nikelantiquedolls.com/wordpress/?page_id=13&id=6
here is the folder im trying to look into
http://nikelantiquedolls.com/wordpress/wp-content/themes/nikkistheme/images/dolls/6
it has nine images in it (1-9.jpg)

wordpress is strange, cause I get this
/home/nikel0/public_html/wordpress/wp-content/plugins/exec-php/includes
output by



    <?php
    echo realpath(dirname(__FILE__));
    ?>

I would use glob with relative paths and echo $ file in your while loop to see what it contains. Also does $row[‘id’] contain anything?

Try this and scroll to the bottom for the source;
http://johns-jokes.com/afiles/gif/

ok, so its working,
http://nikelantiquedolls.com/wordpress/?page_id=13
using


<?php
$files = glob("wp-content/themes/nikkistheme/images/dolls/".$id."/*.jpg");
foreach($files as $file){
echo '<img src="'.$file.'" border="0" />';
}
?>

is this ok?