kohar
02-23-2010, 01:29 PM
Hello,
I have been working on a website, loading images from database with php. There are previous and next links for additional pages, with a limit of 5 images per page. If there is (for example) 17 images the next link is disabled when the last page is reached. However, if the last page is a multiple of 5, the next link does not get disabled as it should. Here is the link for an example.
http://www.alhebert.us/painting.php
If you notice, the painting page has 25 images, so the next link does not work right on the last page.
If you returned home, then went to art metalwork, there are 6 images, and it disables as it should.
if ($nr < 5)
{
echo " | <font color='CCCCCC'>Next</font><br><br>";
}
else
{
echo " | <a href='painting.php?cps=$cps&lps=$lps'>Next</a><br><br>";
}
print "Images $a - $b of $nr0<br><br>";
//print "$a";
//print "$b";
I have been working on a website, loading images from database with php. There are previous and next links for additional pages, with a limit of 5 images per page. If there is (for example) 17 images the next link is disabled when the last page is reached. However, if the last page is a multiple of 5, the next link does not get disabled as it should. Here is the link for an example.
http://www.alhebert.us/painting.php
If you notice, the painting page has 25 images, so the next link does not work right on the last page.
If you returned home, then went to art metalwork, there are 6 images, and it disables as it should.
if ($nr < 5)
{
echo " | <font color='CCCCCC'>Next</font><br><br>";
}
else
{
echo " | <a href='painting.php?cps=$cps&lps=$lps'>Next</a><br><br>";
}
print "Images $a - $b of $nr0<br><br>";
//print "$a";
//print "$b";