hello,
im new to php and im trying to make a photo gallery following a tutorial i found on a site i ccant remember address to. well hte code below is short. but i dont get the whole thing.
first of all i would like someone to explain me what is going on in the while loop in detail. also i dont get the poiint with the fp variable. doesnt look like its been used.
also how can i make the script find the image size and open the new window accordingly? and while we're at ti, i woul like to have a limiteation on the number of thumbs on one site, so that the script wil make display a link for the rest to show.
sounds like a lot, but would be greatful any help.
thanks a lot guys
kumar
<?php
$a = '0';
$filepath = "misc/thumb";
$url_path = "misc/main";
$dir = dir($filepath);
echo "<table border=\"0\" cellpadding=\"2\" cellspacing=\"2\" width=\"100%\">";
while($entry=$dir->read()) {
if($entry == "." || $entry == "..") {
continue;
}
$fp = @fopen("$filepath/$entry","r");
if ($a == '0') {echo "<tr>";}
if ($a == '4') {echo "<tr>";}
if ($a == '8') {echo "<tr>";}
if ($a == '12') {echo "<tr>";}
if ($a == '16') {echo "<tr>";}
?>
<td>
<a href="javascript:Start(' <? echo "$url_path/$entry" ?> ') ">
<img src="<? echo "$filepath/$entry" ?>" alt="<? echo $entry ?>"></a>
</td>
<?
$a = $a + 1;
}
?>
</tr>
</table>
image gallery problem
Moderator: General Moderators