Advertisement
Jordimario

ls

Feb 26th, 2021
1,086
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <?php
  2.  
  3. if (!empty($_GET["image"])){
  4. $im = imagecreatefromstring(file_get_contents("./".$_GET["image"]));
  5.     header('Content-Type: image/*');
  6. imagejpeg($im);
  7. imagedestroy($im);
  8. }
  9. else{
  10.  
  11.  
  12. if(empty($_GET["f"]))$_GET["f"]="./";
  13.  
  14. $arr = scandir($_GET["f"]);
  15.  
  16.  
  17. for($i=0; $i<count($arr);$i++) {
  18.  
  19.     if(getimagesize($_GET["f"]."/".$arr[$i])){
  20.         $arr[$i] = "<a href=".$_SERVER['PHP_SELF']."?f=".$_GET["f"]."&image=".$arr[$i]."><b>".$arr[$i]."</b></a><br><a href=".$_GET["f"]."/".$arr[$i]." style=color:cyan>image</a>";
  21.  
  22. }
  23.     else $arr[$i] = "<a href=".$_SERVER['PHP_SELF']."?f=".$_GET["f"]."/".$arr[$i]."><b>".$arr[$i]."</b></a><br>".file_get_contents($_GET["f"]."/".$arr[$i])."";
  24.    
  25. }
  26.  
  27. echo implode("<br>",$arr);
  28. }
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement