Daniish
asked on
How to display all images in a folder?
Hello,
I'm using the attached code snippet to display all the images in a folder.
The problem is with this line:
<img src='../thumbphp/phpThumb. php?src=/t ravel_pics /$file/'.* .*.'&w=100 ' alt=''/>
I can't get the *.* to work - what am i doing wrong?
Cheers
I'm using the attached code snippet to display all the images in a folder.
The problem is with this line:
<img src='../thumbphp/phpThumb.
I can't get the *.* to work - what am i doing wrong?
Cheers
<?php
if ($handle = opendir('travel_pics/'.$id.'/')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "
<a id='thumb1' href='../public_html/travel_pics/$file/' onclick='return hs.expand(this)' class='highslide'>
<img src='../thumbphp/phpThumb.php?src=/travel_pics/$file/'.*.*.'&w=100' alt=''/>
</a>
";
}
}
closedir($handle);
}
?>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm trying to get it to load all images from each folder....but as you can see it hasn't worked:
www.globxposure.net/index.php
Ultimately the purpose of this exercise is that when you click on an image (click on the Norwich marker), you get the option to view Next/Previous image - and i would like it to cycle through the images that are in the same folder as the image the user has just selected.
Hope you understand me.
www.globxposure.net/index.php
Ultimately the purpose of this exercise is that when you click on an image (click on the Norwich marker), you get the option to view Next/Previous image - and i would like it to cycle through the images that are in the same folder as the image the user has just selected.
Hope you understand me.
ASKER
This was a badly worded question on my part, however, another expert has helped me out so i no longer need to keep this open.
just if it was supposed to be there then it should be
<img src='../thumbphp/phpThumb.