typeobjectfile.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. include "auth.php";
  3. include "qrcode.php";
  4. if (isset($_POST['format']) && $_POST['format'] =='png') {
  5. $machineid = htmlentities(mysqli_real_escape_string($link, $_POST['machine']));
  6. $filelist = glob($PNG_WEB_DIR .$machineid. "/"."*.png");
  7. for ($i = 0; $i < count($filelist); $i++) {
  8. echo "<a href=" . "$filelist[$i]" . "><img src=" . "$filelist[$i]" . ">" . "</a>";
  9. if ($i % 3 == 0)
  10. echo "<br>";
  11. }
  12. }
  13. if (isset($_POST['format']) && $_POST['format'] =='php') {
  14. $machineid = htmlentities(mysqli_real_escape_string($link, $_POST['machine']));
  15. $filelist = glob($PNG_WEB_DIR .$machineid. "/"."*.php");
  16. for ($i = 0; $i < count($filelist); $i++) {
  17. // echo $filelist[$i];
  18. echo "<a href=" . "$filelist[$i]" . ">" . $filelist[$i] . "</a>";
  19. echo "<br>";
  20. }
  21. }
  22. if (isset($_POST['format']) && $_POST['format'] =='txt') {
  23. $machineid = htmlentities(mysqli_real_escape_string($link, $_POST['machine']));
  24. $filelist = glob($PNG_WEB_DIR .$machineid. "/"."*.txt");
  25. for ($i = 0; $i < count($filelist); $i++) {
  26. // echo $filelist[$i];
  27. echo "<a href=" . "$filelist[$i]" . ">" . $filelist[$i] . "</a>";
  28. echo "<br>";
  29. }
  30. }
  31. if (isset($_POST['format']) && $_POST['format'] =='all') {
  32. $machineid = htmlentities(mysqli_real_escape_string($link, $_POST['machine']));
  33. $filelist = glob($PNG_WEB_DIR .$machineid. "/"."*.*");
  34. for ($i = 0; $i < count($filelist); $i++) {
  35. // echo $filelist[$i];
  36. echo "<a href=" . "$filelist[$i]" . ">" . $filelist[$i] . "</a>";
  37. echo "<br>";
  38. }
  39. }
  40. ?>