Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. <html>
  2. <head><title></title></head>
  3. <body>
  4. <table><tr>
  5. <?php
  6. define('Photo_dir','img');
  7. define('Columns',2);
  8. $x=0;
  9. $y=0;
  10. $results = scandir(Photo_dir);
  11. foreach ($results as $result)
  12. {
  13. if ($result === '.' or $result === '..') continue;
  14. if (is_dir(Photo_dir.'/'.$result))
  15. {
  16. if($y > 2)
  17. {
  18. echo "</tr><tr>";
  19. $y=0;
  20. $x=&x+1;
  21. }
  22. echo "<td><img src='image.php?photo=".Photo_dir."/".$result."/1.jpg'/></td>";
  23. echo "kod w html";
  24. }
  25. }
  26. ?>
  27. </tr>
  28. </table>
  29. </body>
  30. </html>
  31.  
  32. $x = $x +1;
  33.  
  34. $x++;
  35.  
  36. <img src='image.php?photo=".Photo_dir."/".$result."/1.jpg'/>
  37. ^ that one.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement