作者martone (Krel)
看板PHP
标题[请益] header()问题
时间Fri Mar 7 18:46:43 2008
出现了以下的错误
Warning: Cannot modify header information - headers already sent by (output
started at .........)
php为:
<? $db = mysql_connect('127.0.0.1:3306', 'root', '1234');
mysql_select_db('vote'); ?>
<?
$count_query = mysql_query("update count set get_vote=get_vote+1 where name =
'$_POST[radio]'");
header("Refresh:3;URL=test.php");
?>
只是想让php对资料库+1後就回主页,但却不行,请问这样的错误该如何解决呢?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 118.170.39.110
※ 编辑: martone 来自: 118.170.39.110 (03/07 18:48)
1F:推 chweng:你好像把错误讯息的重点切掉了 03/07 19:37
2F:→ chweng:他不是有告诉你header是从哪边开始送出的吗 03/07 19:38
3F:→ ybite:把中间的?>和<?拿掉 03/07 19:38
4F:→ ybite:那个地方应该会生出header 03/07 19:38
5F:推 ileadu:FAQ (音好像脏话啊) 03/07 19:38
6F:推 dspswen:bom ? utf-8 ? 03/07 20:36
7F:推 edl2000:应该是 bom 的问题吧, 昨天才遇到 03/07 21:51
8F:→ arianda:mysql_select_db('vote'); ?> 和下面的<?有空白, 3f正解 03/07 21:56
9F:→ martone:感谢各位^^" 03/07 23:43