[FIXED] session_start() error: cannot send session...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Andre_
Forum Newbie
Posts: 2
Joined: Sat May 30, 2009 1:22 pm

[FIXED] session_start() error: cannot send session...

Post by Andre_ »

Hi!

I've been browsing Google for a hour now or so and I'm totally unable to find any help on my case. As I understand, DevNetwork is the biggest PHP development forum with a decent community consisting of experienced coders. I'm glad that I found you, perhaps you can give me some assistance.

For the record, I don't have _any_ whitespace before I call <?php session_start(), my code looks like this:

Code: Select all

<?php
session_start();
 
if($_SESSION["logged"] == 1) $LOGGED = 1;
if($_SESSION["logged"] == 0) $LOGGED = 0;
 
include("functionsINC.php");
include("mysqlINC.php");
?>
I don't have a single idea what might be causing this issue:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\panel\index.php:1) in C:\xampp\htdocs\panel\index.php on line 2

I use XAMPP application with Apache webserver and MySQL on my localhost. I ran the script live on my host, yet I resulted with the same issue.

I'll try to patch you in with what my "panel" does. It is a management panel for a popular SA-MP server gamemode that me and my friends are developing (it is coded in PAWN formerly known as Small, which is similar to C languages). We thought of making a PHP panel where player could see various data about themselves and administrators could modify data from ban list (ban removal, changing, adding, etc.), modify player data, see history of stuff in the server.
A few months ago I read a tutorial on sessions and login script for PHP, that my friend kc linked me to. I can recall session_start() function with all the stuff I'm doing now also. I don't have a single idea, as I said.

If it is needed, I will give you the whole code.

Thank you very much!
- Andre
Andre_
Forum Newbie
Posts: 2
Joined: Sat May 30, 2009 1:22 pm

Re: [FIXED] session_start() error: cannot send session...

Post by Andre_ »

As I said, it isn't about the whitespace... or it was!
Windows Expression Web was adding a BOM marker making PHP think there is a body tag!
Post Reply