Home > Backend Development > PHP Tutorial > PHP输出图像到浏览器的有关问题

PHP输出图像到浏览器的有关问题

WBOY
Release: 2016-06-13 12:05:24
Original
1061 people have browsed it

PHP输出图像到浏览器的问题
新手才学PHP绘制图像然后输出到浏览器,为什么用IE的时候提示的是下载图片,用chrome的时候是正常显示的,下面是代码

<br />$image = imagecreatetruecolor(300, 300);<br />$white = imagecolorallocate($image, 0,0,64);<br />imagefill($image,0,0,$white);<br />header("Content-type:image/png");<br />imagepng($image);<br />
Copy after login

------解决方案--------------------
代码没有问题,你用IE几测试的。
------解决方案--------------------
代码是正常的。是不是你安装了插件,访问图片会直接下载?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template