
Originally Posted by
lbrassaw
Hello. I am overlooking something. My code prints thumbnail images in groups of 8; but each time I click a thumbnail, that image goes to position 1 of the displayed thumbnail images. If you could point out my folly, I'd appreciate it!
Here's the section of the code:
if ($_GET["img"]) {
$i = $_GET["img"];
}
else {
$i = 1;
}
$dir = 'texture/thumbnails/';
$filecount = 0;
$d = dir($dir);
while ($f = $d->read()) {
if(($f!= ".") && ($f!= "..")) {
if(!is_dir($f)) $filecount++;
PHP Code:
$extensions = array(".JPG",".jpg", ".jpeg");
if ($handle1 = opendir('texture/thumbnails/'))
{
while (false !== ($file1 = readdir($handle1)))
{
if (in_array((strrchr(strtolower($file1), '.')),$extensions) && !is_dir($file1) && $file1!="." && $file1!="..") //Checks that the extension is on the list
{
$lcount++;
}
}
}
more information for see this article
http://www.phpasks.com/articles/howt...directory.html