<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.11" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: PHP 的 &#34;Header already sent&#34; 錯誤</title>
	<link>http://www.real-blog.com/programming/385</link>
	<description>關於 PHP, Linux, Open Source 及個人生活記載的網誌。</description>
	<pubDate>Tue, 07 Oct 2008 03:28:24 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.11</generator>

	<item>
		<title>by: Sam Tang</title>
		<link>http://www.real-blog.com/programming/385#comment-8048</link>
		<pubDate>Fri, 19 Oct 2007 07:23:31 +0000</pubDate>
		<guid>http://www.real-blog.com/programming/385#comment-8048</guid>
					<description>因為輸出圖片前曾經輸出其他內容，那便會有 "headers already sent" 錯誤，其中空格及空行等看不見的字符也一樣。</description>
		<content:encoded><![CDATA[<p>因為輸出圖片前曾經輸出其他內容，那便會有 &#8220;headers already sent&#8221; 錯誤，其中空格及空行等看不見的字符也一樣。
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: steven</title>
		<link>http://www.real-blog.com/programming/385#comment-8046</link>
		<pubDate>Wed, 17 Oct 2007 08:41:52 +0000</pubDate>
		<guid>http://www.real-blog.com/programming/385#comment-8046</guid>
					<description>Hi~~你好

想請教您一個問題

小弟剛開始學習PHP,現有以下一問題

上傳測試程式後

在 gd_info 下GD Version ----2.0.34 compatible

在 PHP + GD Library 繪圖測試程式

＜?php
header ("Content-type: image/png");

$im = @imagecreate (500, 400) or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 0, 196, 0);
$text_color = imagecolorallocate ($im, 255, 255, 0);
$pen_color = imagecolorallocate($im, 255, 255, 255);

imagestring ($im, 2, 160, 35, "OK ! You can draw graph in PHP !", $text_color);
imageline($im, 1, 1, 500, 400, $pen_color);
imageline($im, 500, 1, 1, 400, $pen_color);
imageellipse($im, 250, 200, 200, 200, $pen_color);
imageellipse($im, 250, 200, 240, 240, $pen_color);
imagepng ($im);
?＞

卻出現
Warning: Cannot modify header information - headers already sent by

和一堆亂碼

請問如何解決呢???</description>
		<content:encoded><![CDATA[<p>Hi~~你好</p>
<p>想請教您一個問題</p>
<p>小弟剛開始學習PHP,現有以下一問題</p>
<p>上傳測試程式後</p>
<p>在 gd_info 下GD Version &#8212;-2.0.34 compatible</p>
<p>在 PHP + GD Library 繪圖測試程式</p>
<p>＜?php<br />
header (&#8221;Content-type: image/png&#8221;);</p>
<p>$im = @imagecreate (500, 400) or die (&#8221;Cannot Initialize new GD image stream&#8221;);<br />
$background_color = imagecolorallocate ($im, 0, 196, 0);<br />
$text_color = imagecolorallocate ($im, 255, 255, 0);<br />
$pen_color = imagecolorallocate($im, 255, 255, 255);</p>
<p>imagestring ($im, 2, 160, 35, &#8220;OK ! You can draw graph in PHP !&#8221;, $text_color);<br />
imageline($im, 1, 1, 500, 400, $pen_color);<br />
imageline($im, 500, 1, 1, 400, $pen_color);<br />
imageellipse($im, 250, 200, 200, 200, $pen_color);<br />
imageellipse($im, 250, 200, 240, 240, $pen_color);<br />
imagepng ($im);<br />
?＞</p>
<p>卻出現<br />
Warning: Cannot modify header information - headers already sent by</p>
<p>和一堆亂碼</p>
<p>請問如何解決呢???
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
