PHP Photo Gallery
Posted: Fri Jan 16, 2004 12:23 pm
Hello I have a question regarding my photo gallery script
I have 20 thumbnails on a page when I click on one it goes to a larger version of that photo that is in the directory I would like the photo when clicked to go to an html or php page instead to display the photo
Anyhelp is always appreciated here is the code
Sorry about the mess
Thanks in advance
There is more to the script but I don't believe it is nessacary it is just the
next previous links
I have 20 thumbnails on a page when I click on one it goes to a larger version of that photo that is in the directory I would like the photo when clicked to go to an html or php page instead to display the photo
Anyhelp is always appreciated here is the code
Sorry about the mess
Code: Select all
<?php
$a = 0;
$new_tr = 0;
$filepath = "thumbnails";
$url_path = "images2";
$dir = dir($filepath);
$start=0;
$stop=22;
if(!empty($_GETї'start']) && !empty($_GETї'stop'])) {
$start=intval($_GETї'start']);
$stop=intval($_GETї'stop']);
}
echo "<table width="640" border="0" cellpadding="1" cellspacing="1">";
while($entry=$dir->read()) {
if($a>=$start && $a<$stop) { // $a<$stop because from 0-19 you have 20 pictures
if($entry != "." && $entry != "..") {
if (!($new_tr%5)) {echo "<tr>";}
?>
<td align="center" valign="top">
<a href="<?php echo "$url_path/$entry/" ?>">
<img src="<?php echo "$filepath/$entry"; ?>" alt="<?php echo $entry; ?>" border="1" class="imageborder"></a>
</td>There is more to the script but I don't believe it is nessacary it is just the
next previous links