Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (!empty($_GET["image"])){
- $im = imagecreatefromstring(file_get_contents("./".$_GET["image"]));
- header('Content-Type: image/*');
- imagejpeg($im);
- imagedestroy($im);
- }
- else{
- if(empty($_GET["f"]))$_GET["f"]="./";
- $arr = scandir($_GET["f"]);
- for($i=0; $i<count($arr);$i++) {
- if(getimagesize($_GET["f"]."/".$arr[$i])){
- $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>";
- }
- 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])."";
- }
- echo implode("<br>",$arr);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement