看看header的解释吧 Every page downloaded from a web server is a result of an exchange of HTTP dialogue. The web browser sends a set of instructions to indicate which page it wants to view, and the server responds with a response that indicates the success of the request, along with various other information that is not displayed directly on the web page.The following HTTP headers show some of the information that is sent along with a typical web page from a PHP-enabled web server:HTTP/1.1 200 OK Date: Tue, 14 Dec 2004 21:17:28 GMT Server: Apache/1.3.29 (Unix) mod_gzip/1.3.26.1a PHP/4.3.9 mod_ssl/2.8.16 OpenSSL/0.9.7c X-Powered-By: PHP/4.3.9 Connection: close Content-Type: text/html; charset=iso-8859-1
但只支持png的图,
gif还是不支持,
还有一个问题,Header("Content-type: image/gif");这行代码之前为什么不能插入html代码,一插就报错,如果这样我怎么能在页面里插入图象?
header函数前面本来就不能有任何输出!!看看手册!!不支持gif是因为版权的问题!
Header("Content-type: image/gif"); 是 html协议的头输出,在之前不能有html的正文内容输出,估计是在header()前你echo 了什么东西
Every page downloaded from a web server is a result of an exchange of HTTP dialogue. The web browser sends a set of instructions to indicate which page it wants to view, and the server responds with a response that indicates the success of the request, along with various other information that is not displayed directly on the web page.The following HTTP headers show some of the information that is sent along with a typical web page from a PHP-enabled web server:HTTP/1.1 200 OK
Date: Tue, 14 Dec 2004 21:17:28 GMT
Server: Apache/1.3.29 (Unix) mod_gzip/1.3.26.1a PHP/4.3.9
mod_ssl/2.8.16 OpenSSL/0.9.7c
X-Powered-By: PHP/4.3.9
Connection: close
Content-Type: text/html; charset=iso-8859-1