load a php image using src

前端 未结 6 1265
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-20 10:46

Is it possible to load a image using:


?

for image.php:

$ima         


        
6条回答
  •  甜味超标
    2020-12-20 11:13

    you must return a valid image, use file_get_contents or readfile for get the conent of image then output to browser

     header("Content-Type:image/png");
    
        $image_id = $_GET['image_id']; 
    
        if(is_file($file = "image".$image_id.".png") ||  is_file($file = "no_image.png"))
            readfile($file); 
    

提交回复
热议问题