开发者

session_start warning on line 1

I have a php file that starts out with:

<?php include "header.php"; ?>

The file header.php starts out with:

<?php session_start();
$login_output = "";

if ($_GET['process'] == 'logout') {
session_destroy();
} 

It's giving me this warning: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/clicker/public_html/hstrial-RBochner/criteria.php:1) in /home/clicker/public_html/hstrial-RBochner/criteria.php on line 1

Am I crazy or is this saying it can't print line 1 because it's printing line 1? It works fine in all but one pesk开发者_运维知识库y file. I think I've checked everywhere for whitespace.


You cannot have any whitespaces before <?php session_start(); ?> runs the <?php should be the first string in file criteria.php ;)


If your file is in Unicode format, then it has a pseudo-invisible Unicode "marker" as the first few characters.

As far as PHP is concerned, this is "output" before your header command, and there must be no output before header.

Try making your source file not Unicode.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜