Advertisement
Guest User

Untitled

a guest
May 21st, 2019
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <?php
  2. function iterateDirectory($i)
  3. {
  4. echo '<ul>';
  5. foreach ($i as $path) {
  6. if ($path->isDir())
  7. {
  8. echo '<li>';
  9. iterateDirectory($path);
  10. echo '</li>';
  11. }
  12. else
  13. {
  14. echo '<li>'.$path.'';
  15. echo "<form action='delete.php' method='POST'>";
  16. echo "<button type='submit' class='btn btn-secondary'>Delete image</button>";
  17. echo "</form>";
  18. echo "</li>";
  19. }
  20. }
  21. echo '</ul>';
  22. }
  23.  
  24. $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($curuser));
  25.  
  26. iterateDirectory($iterator);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement