944,004 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 4473
  • PHP RSS
Jan 14th, 2005
0

php photo gallery extra code needed

Expand Post »
Hi i have this code to create a photo gallery on my website.
PHP Syntax (Toggle Plain Text)
  1. <html> <head>
  2. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  3. <meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
  4. </head> <body bgcolor="#FFFFFF">
  5. <div align="center"><center>
  6. <?php
  7. $a = '0';
  8. $filepath = "thumb";
  9. $url_path = "main";
  10. $dir = dir($filepath);
  11. echo "<table border=\"0\" cellpadding=\"5\" cellspacing=\"5\" width=\"75%\">";
  12. while($entry=$dir->read()) {
  13. if($entry == "." || $entry == "..") {
  14. continue;
  15. }
  16. $fp = @fopen("$filepath/$entry","r");
  17. if ($a == '0') {echo "<tr>";}
  18. if ($a == '5') {echo "<tr>";}
  19. if ($a == '10') {echo "<tr>";}
  20. if ($a == '15') {echo "<tr>";}
  21. ?><td>
  22. <a href="<? echo "$url_path/$entry" ?>">
  23. <img src="<? echo "$filepath/$entry" ?>" alt="<? echo $entry ?>"></a>
  24. </td>
  25. <?
  26. $a = $a + 1;
  27. }
  28. ?>
  29. </tr>
  30. </table>
  31. </center></div>
  32. </body>
  33. </html>

i was wondernig what code would be needed to limit the gallery to only show 10 images per page and to add links at the bottom to allow progression through the gallery.

many thanks
chris
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
overload8219 is offline Offline
1 posts
since Jan 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Turck mmCache no more?
Next Thread in PHP Forum Timeline: Domain Manager Problem





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC