Home > php教程 > php手册 > body text

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

WBOY
Release: 2016-06-13 11:56:00
Original
958 people have browsed it

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

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

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

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!