Hi all!!
i have tried a number of tutorials and tried searching on net too, but all in vain...i have been trying to do some coding for my own website, but not been able to do so accurately...
wht i am doing is tht i have a directory with thumbnail images, and i want to display the thumbnails on the webpage in order of: 4 thumbnails on each row and total or 20 thumbails on each page(5 rows of 4 thumbnails each)
the problem is in pagination and how to get this 4 pics per row and 5 rows per page thing....the code tht i have written till now...excluding my flop research on pagination is:
<TABLE ALIGN=CENTER CELLPADDING=5 CELLSPACING=0 border=0 width="100px" style="text-align:center">
<tr>
<?php
$dir="./images/Apt_thumbs";
if (is_dir($dir)) {
$fd = @opendir($dir);
if($fd) {
while (($part = @readdir($fd)) == true) {
if ($part != "." && $part != "..") {
$break=explode(".", $part);
if(($break[1] == "gif") OR ($break[1] == "jpg") OR ($break[1] == "png"))
{
$file_array[]=$part;
}
}
}
}
sort($file_array);
reset($file_array);
}
//number of total pics in directory
$number_pics = count ($file_array);
for($i=0;$i<$number_pics;$i++)
{
$name=explode('.',$file_array[$i]);
$imgname=$name[0];
print ("<td width=100><img src=\"$dir/$file_array[$i]\"></a></td>");
//print("<tr><TD><img src=\"$dir/$file_array[$currentPic]\"></TD></TR>");
}
?>
</tr>
</table>
now how to change my code to incorporate pagination and also the 4 pics per row and 5 rows in all per page thing!!!!!
i have been working on this problem for too long...any help wud be highly appreciated, but plz dont refer another tutorial else i wud faint.lol
plz help!
Garry