Connecting Tech Pros Worldwide Forums | Help | Site Map

Session error

Titus
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi,

Just received the following error upon running some scripts that
utilize sessions. Don't know what it means by "cache limiter". Can
someone please clarify?

I have a script called "displaypreowned.php" that begins with
"session_start()" and a few lines later have a line
"include("databaseconnector.php")" and "include("stockdisplay.php")"
which in themself also have "session_start()" in it. Don't know if
these multiple "session_start()" caused the error. I tried a test
script with multiple lines of "session_start()" without problem so I'm
not too sure.

Warning: Cannot send session cache limiter - headers already sent
(output started at /stock/displaypreowned.php:8) in
/stock/displaypreowned.php on line 9

Pedro Graca
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Session error


Titus wrote:[color=blue]
> Warning: Cannot send session cache limiter - headers already sent
> (output started at /stock/displaypreowned.php:8) in
> /stock/displaypreowned.php on line 9[/color]

You can't send HTML data before the headers (session_start(),
setcookie(), header(), maybe others).

Line 8 of /stock/displaypreowned.php sends HTML data
Line 9 tries to send a header.


Either remove line 8 or put it after line 9
or use output buffering
http://www.php.net/manual/en/ref.outcontrol.php

specifically the ob_start() function
http://www.php.net/manual/en/function.ob-start.php
--
--= my mail box only accepts =--
--= Content-Type: text/plain =--
--= Size below 10001 bytes =--
Closed Thread