[英]Getting “headers already sent” with Facebook PHP api
尝试加载页面时,我一直收到警告。
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/blazecra/public_html/matt/header.php:23) in /home/blazecra/public_html/matt/facebook/facebook.php on line 37
这是我的header.php文件
<?php
echo '<html>
<head>
<title>MyGag - The Home of Gagging!</title>
<link rel="stylesheet" href="style.css" type="text/css" />
</head>
<body>
<img src="img/nav.png" height="50" width="1000">
<div id="logo">
<a href="index.php"><img src="img/logo.png" height="50" width="150"></a>
</div>
';
?>
在facebook php的第37行上
session_start();
任何想法为什么会这样?
好的,这样说,就是这个header.php中的某处输出了,我知道我在回显,但是那只是html。
如果您了解我,我怎么不退货?
已准备好发送输出后,您将无法执行session_start
。
就像错误说的那样:它无法发送cookie,因为已经准备好发送头了。 每当您开始发送数据时,必须(并且将要)首先发送标头。
在调用该函数之前,请确保没有任何输出发送给用户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.