Re: problem using SESSION
| From: | Brendan W. McAdams | Date: | Wed, 09 Aug 2000 20:27:44 +0000 |
| Subject: | Re: problem using SESSION | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-10989@lists.php.net to get a copy of this message | ||
turn on output buffering in your php.ini
That will set you straight =)
-Brendan
-----
Brendan W. McAdams | ph. (305)377-2880
email: brendan@plexmedia.com | cell: (305)218-6466
Programmer/Systems Administrator | pager: (305)277-4879
Plexus M/2, Inc. | fax: (305)377-2870
http://www.plexmedia.com
"Always listen to the experts; they'll tell you what can't be done and why.
Then do it."
- Robert A. Heinlein
----- Original Message -----
From: "Peter Hicks" <phicks@smartpartner.com>
To: <php-general@lists.php.net>
Sent: Wednesday, August 09, 2000 3:32 PM
Subject: [PHP] problem using SESSION
Hello List,
I have recently installed php4 and I am experementing with sessions.
I have a page containing the following code:
<?
session_start();
session_register("SESSION");
if (! isset($SESSION)) {
$SESSION["count"] = 0;
echo "<li>Counter initialized, please reload this page to see it
increment";
} else {
echo "<li>Waking up session $PHPSESSID";
$SESSION["count"]++;
}
echo "<li>The counter is now $SESSION[count] ";
?>
However, when I view this page I get the following error:
Warning: Cannot send session cookie - headers already sent by
(output started at /usr/local/apache/htdocs/test.php:5) in
/usr/local/apache/htdocs/test.php
on line 15
Warning: Cannot send session cache limiter - headers already sent
by (output started at /usr/local/apache/htdocs/test.php:5) in
/usr/local/apache/htdocs/test.php
on line 15
Counter initialized, please reload this
page to see it increment
The counter is now 0
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net