Hi everyone, first post! 🙂
I am a newbie to PHP. Below is the code I am using for my photo album script.
<?php
$a = '0';
$filepath = "thumb";
$url_path = "main";
$dir = dir($filepath);
echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" width=\"75%\">";
while($entry=$dir->read()) {
if($entry == "." || $entry == "..") {
continue;
}
$fp = @fopen("$filepath/$entry","r");
if ($a == '0') {echo "<tr>";}
if ($a == '5') {echo "<tr>";}
if ($a == '10') {echo "<tr>";}
if ($a == '15') {echo "<tr>";}
?><td>
<a href="<? echo "$url_path/$entry" ?>">
<img src="<? echo "$filepath/$entry" ?>" alt="<? echo $entry ?>"></a>
</td>
<?
$a = $a + 1;
}
?>
Images and their thumbnails are stored in the 'main' and 'thumb' folders respectively (I don't need GD or any image manipulation because all images and thumbnails are prepared offline using Irfanview before uploading).
Now, this code appears to work fine displaying the images, but what I would like to do is be able to add a short description below each thumbnail, and when the thumbnail is clicked, a Javascript-written popup appears showing the full-size image, the short description and also a long description. I would like to do this in a flat file because the server I am using does not allow me to use MySQL.
Thanks in advance to anyone who can help me with this.