我有这个标签,请求php脚本
的图像斑点<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之前,它有效,之后未显示图像,并且浏览器注意"不可能的Caricare l'Immagine"
当我用
wget "http://example.org/show_image.php?id=41"
正确下载图像。
谁能建议我问题可能是什么?预先感谢!
我解决了它。问题是在脚本中 <?php
之前放置的字符(对我的IDE看不见(,标头