By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,992 Members | 934 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,992 IT Pros & Developers. It's quick & easy.

Can someone explain this error to me? :(

P: n/a
Hi!
I can`t understand what php wants from me:( So:
Cannot send session cache limiter - headers already sent (output started at
/home/krecik/public_html/silnik.php:208) in /home/krecik/public_html/silnik.php on
line 251

Line 208: print ( "error: " . mysql_error());
Line 251: session_register("uprawnienia", "zalogowany");

I can understand that sth, is wrong in line 251 after line 208 and it is logical to
me, but I have no idea what possibly could be wrong with line 208.
Yes I know that that it`s better to store session information on server. I already
asked admin to change variable in php.ini.

--
Best regards,
Maciej Nadolski
Jul 17 '05 #1
Share this Question
Share on Google+
11 Replies


P: n/a
"Maciej Nadolski" <us****@WYTNIJ-TO.nadolski.net> wrote in message
news:Xn*******************************@193.110.122 .80...
Hi!
I can`t understand what php wants from me:( So:
Cannot send session cache limiter - headers already sent (output started at /home/krecik/public_html/silnik.php:208) in /home/krecik/public_html/silnik.php on line 251

Line 208: print ( "error: " . mysql_error());
Line 251: session_register("uprawnienia", "zalogowany");

I can understand that sth, is wrong in line 251 after line 208 and it is logical to me, but I have no idea what possibly could be wrong with line 208.
Yes I know that that it`s better to store session information on server. I already asked admin to change variable in php.ini.


Was your session started at the beginning of the script?

- Virgil
Jul 17 '05 #2

P: n/a
"Virgil Green" <vj*@obsydian.com> wrote in
news:UB*********************@newssvr30.news.prodig y.com:

Was your session started at the beginning of the script?

Nope.
I only set this:
session_cache_expire(3600);
I`m not sure is it setting of a session...

--
Best regards,
Maciej Nadolski
Jul 17 '05 #3

P: n/a
"Maciej Nadolski" <us****@WYTNIJ-TO.nadolski.net> wrote in message
news:Xn*******************************@193.110.122 .80...
Hi!
I can`t understand what php wants from me:( So:
Cannot send session cache limiter - headers already sent (output started at /home/krecik/public_html/silnik.php:208) in /home/krecik/public_html/silnik.php on line 251

Line 208: print ( "error: " . mysql_error());
Line 251: session_register("uprawnienia", "zalogowany");

I can understand that sth, is wrong in line 251 after line 208 and it is logical to me, but I have no idea what possibly could be wrong with line 208.
Yes I know that that it`s better to store session information on server. I already asked admin to change variable in php.ini.

--
Best regards,
Maciej Nadolski

all session stuff, like registering variables, has do be done befor you
"print" any html code, because then the train has gone ;)
Jul 17 '05 #4

P: n/a
"Jrrn-Inge Kristiansen" <jo******@stud.ntnu.no> wrote in
news:bl*********@tyfon.itea.ntnu.no:
all session stuff, like registering variables, has do be done befor
you "print" any html code, because then the train has gone ;)

Thanks.

--
Best regards,
Maciej Nadolski
Jul 17 '05 #5

P: n/a
"Jrrn-Inge Kristiansen" <jo******@stud.ntnu.no> wrote in
news:bl*********@tyfon.itea.ntnu.no:

all session stuff, like registering variables, has do be done befor
you "print" any html code, because then the train has gone ;)


Now session is started BEFORE user log himself in.
I eliminated print which in fact there was telling which rights ypu have.
And I still have something like that:
Warning: session_register(): Cannot send session cache limiter - headers already
sent (output started at /home/krecik/public_html/funkcje.php:212) in
/home/krecik/public_html/funkcje.php on line 239
Any more ideas?

--
Best regards,
Maciej Nadolski
Jul 17 '05 #6

P: n/a
Maciej Nadolski <us****@WYTNIJ-TO.nadolski.net> schrieb:
I eliminated print which in fact there was telling which rights ypu have.
And I still have something like that:
Warning: session_register(): Cannot send session cache limiter - headers already
sent (output started at /home/krecik/public_html/funkcje.php:212) in
/home/krecik/public_html/funkcje.php on line 239
Any more ideas?


Yes. You have an ouptput in line 212 of the file
/home/krecik/public_html/funkcje.php

Regards,
Matthias
Jul 17 '05 #7

P: n/a
Matthias Esken <mu******************@usenetverwaltung.org> wrote in
news:bl**********@usenet.esken.de:
Yes. You have an ouptput in line 212 of the file
/home/krecik/public_html/funkcje.php


Thanks.

line 212 looks like this:
print ( "error: " . mysql_error());
I still van`t ungerstand what outout then means:( Could someone explain THIS to
me? :) TIA

--
Best regards,
Maciej Nadolski
Jul 17 '05 #8

P: n/a
Maciej Nadolski wrote:
Yes. You have an ouptput in line 212 of the file
/home/krecik/public_html/funkcje.php
line 212 looks like this:
print ( "error: " . mysql_error());
I still van`t ungerstand what outout then means:( Could someone explain
THIS to me? :) TIA


You have a function which is called prior to session_start(), like this:

<?php
someMySQLFunction();
// foo...
session_start(); // or other session_* function
?>

If there is an error while talking with MySQL server, your function will
issue an error and you cannot send headers after that. Reverse the function
calls.

--
Dado

Expect the worst, it's the least you can do.
Jul 17 '05 #9

P: n/a
Maciej Nadolski <us****@WYTNIJ-TO.nadolski.net> schrieb:
Matthias Esken <mu******************@usenetverwaltung.org> wrote in
news:bl**********@usenet.esken.de:
Yes. You have an ouptput in line 212 of the file
/home/krecik/public_html/funkcje.php


line 212 looks like this:
print ( "error: " . mysql_error());
I still van`t ungerstand what outout then means:( Could someone explain THIS to
me? :) TIA


You're nort allowed to have _any_ output before you use the header()
function. print, echo or print_r will generate an output.

Regards,
Matthias
Jul 17 '05 #10

P: n/a
Maciej Nadolski wrote:
[...]
I still van`t ungerstand what outout then means:( Could someone explain THIS to
me? :) TIA


--------
<?php
echo '<html>';
session_start(); ### error: html was echo'd before the needed
### session_start() call
?>
========
or
--------
<html>
<head>
<title>test</title>
</head>
<body>
<?php
session_start(); ### error: the first output was "<html>"
?>
</body>
</html>
========
or
--------
<?php
include 'standard.inc.php';
session_start(); ### error if standard.inc.php outputs anything
### other than other headers
?>
<head><head><title>!!!</title></head><body><p>!!!</p></body></html>
========

HTH
--
I have a spam filter working.
To mail me include "urkxvq" (with or without the quotes)
in the subject line, or your mail will be ruthlessly discarded.
Jul 17 '05 #11

P: n/a
Pedro <he****@hotpop.com> wrote in
news:bm************@ID-203069.news.uni-berlin.de:
--------
<?php
echo '<html>';
session_start(); ### error: html was echo'd before the needed
### session_start() call
?>


Thanks!
Now I understand it. Print displaying the error message from mysql and it was the
problem. Thanks again for patience.

--
Best regards,
Maciej Nadolski
Jul 17 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.