Can someone help with a php script that tries to display an image, where the image links to the previous image?
Example: I have many images in a 'gallery' directory along with other files, such as info.txt, header.jpg, 705.jpg, 704.jpg, 703.jpg, 702.jpg, 701.jpg
I'd like to create an 'image.php' page that does the following:
- display the largest jpg (in this case, 705.jpg) from the 'gallery' folder
- clicking on the image will then reload the page but display the next largest image (in this case, 704.jpg)
- and so on, as each image is clicked, the next largest image will be displayed.
I have a similar script that I modified, that displays the largest image, but clicking it just loads the actual image. Not very smart (me or the script!) I'm not sure what would have to be done so that the link could reload the page (with a paramater, perhaps?) that would link to / display the next image in the sequence.
Any help would be much appreciated, thanks! (I'm also willing to send someone a small paypal fee if they can quickly help.)
Thanks,
Chum
Example: I have many images in a 'gallery' directory along with other files, such as info.txt, header.jpg, 705.jpg, 704.jpg, 703.jpg, 702.jpg, 701.jpg
I'd like to create an 'image.php' page that does the following:
- display the largest jpg (in this case, 705.jpg) from the 'gallery' folder
- clicking on the image will then reload the page but display the next largest image (in this case, 704.jpg)
- and so on, as each image is clicked, the next largest image will be displayed.
I have a similar script that I modified, that displays the largest image, but clicking it just loads the actual image. Not very smart (me or the script!) I'm not sure what would have to be done so that the link could reload the page (with a paramater, perhaps?) that would link to / display the next image in the sequence.
Any help would be much appreciated, thanks! (I'm also willing to send someone a small paypal fee if they can quickly help.)
Code:
<?php $images = glob('gallery/*.jpg'); $images = array_reverse($images); for ($i = 0; $i < 1; $i++) { echo '<a href="' . $images[$i] . '"><img src="' . $images[$i] . '" alt="" /></a>'; } ?>
Chum
Comment