(solved)handling images are tough!
Posted: Thu Aug 25, 2005 2:20 am
the following code displays all the images in folder "thimg"
the next one display.php is supposed to show only the particular large image when clicked on its thumbnail.instead displays all the images in "upimg" folder..which is fair cos the codes say so too..now i know i have to pass some parameters so dat it displays only one image at a time when clicked on its thumbnail..how do i do it? i mean i dont get the very concept of passing parameters..i looked up on the net..but the explanations are very vague..
can anyone here please explain wat i ought to be doing?
thank u
Code: Select all
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="GENERATOR">
<title>Everything Graphik Image Gallery</title>
</head>
<body bgcolor="#F0F0E8" a:hover="#6F6F69" a:linked="#6F6F69">
<center>
<br>
<br>
<table width="800" border="0">
<tr>
<td width="56%"><img src="logo.jpg"></td>
<td width="44%" align="right"><font color="#6F6F69" face="Verdana, Arial, Helvetica, sans-serif" size="-4">everything graphik, site personnel d'antoine ricardou. plus d'infos sur <a href="http://www.be-poles.com">www.be-poles.com</a></font></td>
</tr>
</table>
<p align="left"><font color="#6F6F69" face="verdana"> Month/Year <a href="#">back</a> <a href="#">next</a></font></p>
<?php
$a = '0';
$filepath = "thimg";
$url_path = "upimg";
$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 == '1') {echo "<tr>";}
if ($a == '11') {echo "<tr>";}
if ($a == '21') {echo "<tr>";}
if ($a == '31') {echo "<tr>";}
?><br>
</center>
<div align="center">
<center>
<td width="40"><a href="display.php"><img src='<? print"$filepath/$entry" ?>' alt="<? echo $entry ?>"></a></td>
<? $a = ($a + 1);
}
?>
</tr>
</table></center>
</div>
</body>
</html>Code: Select all
<?php
$url_path = "upimg";
$dir = dir($url_path);
while($entry=$dir->read())
{
if($entry == "." || $entry == "..") {
continue;
}
//$fp = @fopen("$url_path/$entry","r");
?>
<center>
<a href="image.php"><img src='<? echo"$url_path/$entry"?>' alt="<? echo $entry ?>"></a>
<?
}
?>
</center>thank u