使用标题功能时出现问题。警告:无法修改标头信息 [英] Problem using the header function. Warning: Cannot modify header information

查看:152
本文介绍了使用标题功能时出现问题。警告:无法修改标头信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我使用此编码从数据库中检索文件,以便我的用户可以下载文件...

展开 | 选择 | Wrap | 行号

解决方案

我又来了..

i尝试使用你的编码...

全部...

我对第4阶段的编码有问题...


每当我想下载,,,

它会给我一个警告......类似于之前的警告..

展开 | 选择 | 换行 | 行号


< BLOCKQUOTE>嗨。欢迎使用Bytes!


当您在向响应中添加内容后尝试修改标题信息时,会显示此错误。


要使用标头功能,在调用之前不能将任何内容添加到响应中。甚至没有一个白色空间。添加任何内容后,标题将被锁定。


查看downloadprocess.php中的第13行并查看其中的内容。错误表明这是您开始添加输出的地方。


P.S.我已经把你的问题转移到它在PHP论坛中自己的主题,所以不要挤满文章的评论主题。


也许是一个愚蠢的问题,但是你的connectdb.php有任何输出(echo / print)?如果是,您将在完成修改标题之前发送信息并获得该错误。


hi there, i m using this coding to retrieve the file from database so that my user can download the file...

Expand|Select|Wrap|Line Numbers

解决方案

hi it''s me again..
i try to use your coding...
all of it...
i''ve got problem with the coding on phase 4...

whenever i want to download,,,
it will give me a warning...similar to the previous warning..

Expand|Select|Wrap|Line Numbers


Hi. Welcome to Bytes!

This error is shown when you try to modify the header information after you have already added content to the response.

To use the header function, nothing can be added to the response before it is called. Not even a single white-space. After anything is added, the headers are locked.

Check out line 13 in your downloadprocess.php and see what''s there. The error indicates that this is where you started adding output.

P.S. I''ve moved your question into it''s own thread in the PHP Forums, so not to crowd the article''s comment thread.


Maybe a silly question, but does your connectdb.php have any output (echo/print)? If it does, you will have sent info before finished modifying the headers and get that error.


这篇关于使用标题功能时出现问题。警告:无法修改标头信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆