Connecting Tech Pros Worldwide Forums | Help | Site Map

Can someone explain this error to me? :(

Maciej Nadolski
Guest
 
Posts: n/a
#1: Jul 17 '05
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

Virgil Green
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Can someone explain this error to me? :(


"Maciej Nadolski" <usenet@WYTNIJ-TO.nadolski.net> wrote in message
news:Xns940CB884B6335usenetnadolskinet@193.110.122 .80...[color=blue]
> Hi!
> I can`t understand what php wants from me:( So:
> Cannot send session cache limiter - headers already sent (output started[/color]
at[color=blue]
> /home/krecik/public_html/silnik.php:208) in[/color]
/home/krecik/public_html/silnik.php on[color=blue]
> 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[/color]
logical to[color=blue]
> 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[/color]
already[color=blue]
> asked admin to change variable in php.ini.[/color]

Was your session started at the beginning of the script?

- Virgil


Maciej Nadolski
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Can someone explain this error to me? :(


"Virgil Green" <vjg@obsydian.com> wrote in
news:UBggb.549$g56.410262689@newssvr30.news.prodig y.com:
[color=blue]
>
> Was your session started at the beginning of the script?
>[/color]
Nope.
I only set this:
session_cache_expire(3600);
I`m not sure is it setting of a session...

--
Best regards,
Maciej Nadolski
Jørn-Inge Kristiansen
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Can someone explain this error to me? :(


"Maciej Nadolski" <usenet@WYTNIJ-TO.nadolski.net> wrote in message
news:Xns940CB884B6335usenetnadolskinet@193.110.122 .80...[color=blue]
> Hi!
> I can`t understand what php wants from me:( So:
> Cannot send session cache limiter - headers already sent (output started[/color]
at[color=blue]
> /home/krecik/public_html/silnik.php:208) in[/color]
/home/krecik/public_html/silnik.php on[color=blue]
> 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[/color]
logical to[color=blue]
> 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[/color]
already[color=blue]
> asked admin to change variable in php.ini.
>
> --
> Best regards,
> Maciej Nadolski[/color]


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


Maciej Nadolski
Guest
 
Posts: n/a
#5: Jul 17 '05

re: Can someone explain this error to me? :(


"Jrrn-Inge Kristiansen" <jorninge@stud.ntnu.no> wrote in
news:blsc8d$mc$1@tyfon.itea.ntnu.no:
[color=blue]
> all session stuff, like registering variables, has do be done befor
> you "print" any html code, because then the train has gone ;)[/color]
Thanks.

--
Best regards,
Maciej Nadolski
Maciej Nadolski
Guest
 
Posts: n/a
#6: Jul 17 '05

re: Can someone explain this error to me? :(


"Jrrn-Inge Kristiansen" <jorninge@stud.ntnu.no> wrote in
news:blsc8d$mc$1@tyfon.itea.ntnu.no:
[color=blue]
>
> all session stuff, like registering variables, has do be done befor
> you "print" any html code, because then the train has gone ;)
>[/color]

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
Matthias Esken
Guest
 
Posts: n/a
#7: Jul 17 '05

re: Can someone explain this error to me? :(


Maciej Nadolski <usenet@WYTNIJ-TO.nadolski.net> schrieb:
[color=blue]
> 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?[/color]

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

Regards,
Matthias
Maciej Nadolski
Guest
 
Posts: n/a
#8: Jul 17 '05

re: Can someone explain this error to me? :(


Matthias Esken <muelleimer2003nospam@usenetverwaltung.org> wrote in
news:blv3pl.15c.1@usenet.esken.de:
[color=blue]
> Yes. You have an ouptput in line 212 of the file
> /home/krecik/public_html/funkcje.php[/color]

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
Dalibor Karlovic
Guest
 
Posts: n/a
#9: Jul 17 '05

re: Can someone explain this error to me? :(


Maciej Nadolski wrote:
[color=blue][color=green]
>> Yes. You have an ouptput in line 212 of the file
>> /home/krecik/public_html/funkcje.php[/color][/color]
[color=blue]
> 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[/color]

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.
Matthias Esken
Guest
 
Posts: n/a
#10: Jul 17 '05

re: Can someone explain this error to me? :(


Maciej Nadolski <usenet@WYTNIJ-TO.nadolski.net> schrieb:
[color=blue]
> Matthias Esken <muelleimer2003nospam@usenetverwaltung.org> wrote in
> news:blv3pl.15c.1@usenet.esken.de:
>[color=green]
>> Yes. You have an ouptput in line 212 of the file
>> /home/krecik/public_html/funkcje.php[/color]
>
> 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[/color]

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
Pedro
Guest
 
Posts: n/a
#11: Jul 17 '05

re: Can someone explain this error to me? :(


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

--------
<?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.
Maciej Nadolski
Guest
 
Posts: n/a
#12: Jul 17 '05

re: Can someone explain this error to me? :(


Pedro <hexkid@hotpop.com> wrote in
news:bm1n2i$hje0t$1@ID-203069.news.uni-berlin.de:
[color=blue]
> --------
> <?php
> echo '<html>';
> session_start(); ### error: html was echo'd before the needed
> ### session_start() call
> ?>[/color]

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
Closed Thread