This topic has been archived. It cannot be replied.
-
工作学习 / 专业技术讨论 / 问题,解决Warning: Cannot modify header information - headers already sent by ...这个问题,那种方法最有效?
-countryroad(路谣);
2005-7-12
(#2394997@0)
-
this is really bugging me...
-countryroad(路谣);
2005-7-12
(#2395031@0)
-
Why it was not happening on my local server at home, but once it goes to the internet public domain, it happends all the time.
-countryroad(路谣);
2005-7-12
(#2395041@0)
-
先要问问你要干吗?HTTP的header只能发送一次。我估计你用的服务器server在你的code之前发了些banner,这样你就不能调用header了。如果是jump to other page,用javascript吧。
-canadiantire(轮胎-M.I.N.K.);
2005-7-12
(#2395081@0)
-
yes, try to jump to another page from the current one. I am modifying the code now. Alot of places to fix.
-countryroad(路谣);
2005-7-12
(#2395104@0)
-
我一般用这样一个functionfunction redirect($url, $target="top") {
if(headers_sent()) {
print('<html><head><script language="javascript" type="text/javascript"> window.'.$target.'.location="'.$url.'"; </script></head></html>');
die();
} else {
header("location: ".$url);
exit;
}
}
-canadiantire(轮胎-M.I.N.K.);
2005-7-12
{292}
(#2395113@0)
-
Thanks, This method works. Another Gao Ren
-countryroad(路谣);
2005-7-12
(#2395177@0)
-
终于找到原因了。不是因为我的服务商在我的页面里发了BANNER,是由于文件在上传时,setting 文件的最后多了几个空行。是在<?php ... ?>后多了几个空行。以前从来没有碰到这个问题。删除空行后,什么都不用改了。
I am sooooo happy.
-countryroad(路谣);
2005-7-12
{202}
(#2395187@0)