我正在尝试使用一个函数来使其正常工作:
<img src='login.php?image=ind_legend.jpg'>但是我不能通过这个函数来放置图像。我返回了几个步骤,只尝试了代码的这一部分:
<?php
$file = "http://localhost/sales/test.jpg";
header('Content-type: image/jpeg');
readfile($file);
?>或使用此函数:
echo file_get_contents($source);但事实是,我在Firefox中得到的唯一东西是一个损坏的图像交叉(IE)或什么都没有。
如果有任何建议,我将不胜感激。
提前感谢
发布于 2011-05-04 08:52:02
如前所述,您可能有一些空格。我会尝试用下面的代码替换整个文件。删除结束的php语句可以消除出现额外空格的可能性:
<?php
$file = "http://localhost/sales/test.jpg";
header('Content-type: image/jpeg');
readfile($file);https://stackoverflow.com/questions/5877138
复制相似问题