PHP Error :

Status
Not open for further replies.

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
Hi

Code:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/anujweb/public_html/Check.php:3) in /home/anujweb/public_html/Check.php on line 7


why does this error occur..this does not come up when run the page on localhost using apchetriad.....


How to remove it ??

thanks
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
session_start() MUST be the first thing to output (like with cookies) if any output has occured before that command, you'll get that error.

EDIT: watch your first line!
Code:
<?php
sends already output!
 
Last edited:

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
ok...thanks i'll keep that in mind
but session_start is a php command
how can it begin before <?php ??
 
Last edited:

marshian

New Member
Messages
526
Reaction score
9
Points
0
I didn't say that, but it has to be the first thing to send output
like:
PHP:
<?php
session_start();
is right
PHP:
<?php
session_start();
gives that error
PHP:
<?php
echo "text";
session_start();
= error

EDIT: send output, not execute
like this:
PHP:
<?php
$var = "something";
//do a lot of stuff that does not output anything
session_start();
 
Last edited:
Status
Not open for further replies.
Top