Home > php教程 > php手册 > PHP中header和session_start前不能有输出的原因

PHP中header和session_start前不能有输出的原因

WBOY
Release: 2016-06-13 09:56:40
Original
813 people have browsed it

PHP中header和session_start前不能有输出的原因,下面分析给大家看看。

在http传输文本中,规定必须 header和content顺序必须是:header在前content在后,并且header的格式必须满足“keyword: valuen”这种格式。

1、在header输出之前有输出内容的话,就会造成对header的错误理解(尽管现在已经能容错了),例如不是满足“keyword: valuen”的格式还好,直接错误了,但是满足“keyword: valuen”这个格式以后,客户端是否安装错误理解,还是按照正确理解?

2、session开启是会隐含的触发是否用header(“Set-Cookie: sid=xxxxxx”),也就是其实还是一个隐式的header调用

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template