不再显示从php 5.3到php 5.6的迁移以及src属性中的结果图像

问题描述 投票:0回答:1

我有这个标签从php脚本请求图像blob

<img src="https://example.org/show_image.php?id=41" width="200" height="142">

php脚本是

$connection = @mysqli_connect($nome_host, $nome_user, $password) or die();  
$in_id = (int) $_GET['id'];  
$res_image=mysqli_query($connection,'SELECT content FROM image WHERE id_image='.$in_id) or die();  
$image = mysqli_fetch_array($res_image);  
header("Content-Type: image/pjpeg");  
header("Content-Disposition: inline; filename=image.jpg");  
echo $image['content'];

在迁移到php 5.6之前它工作,之后图像没有显示,浏览器注意到“Impossibile caricare l'immagine” 当我调试脚本时

wget "http://example.org/show_image.php?id=41"

图像下载正确。

谁能告诉我问题是什么?提前致谢!

php image-processing
1个回答
0
投票

我解决了问题是在脚本中的<?php之前放置的一个字符(我的IDE看不到),这会弄脏标题

© www.soinside.com 2019 - 2024. All rights reserved.