RE: [PHP] Help with Sessions

From: Date: Fri, 28 Feb 2003 16:03:29 +0000
Subject: RE: [PHP] Help with Sessions
Groups: php.general 
Request: Send a blank email to php-general+get-137582@lists.php.net to get a copy of this message
Thanks everyone! it worked fine now! -----Original Message----- From: Tom Rogers [mailto:trogers@kwikin.com] Sent: Friday, February 28, 2003 10:58 AM To: Poon, Kelvin (Infomart) Cc: 'php-general@lists.php.net' Subject: Re: [PHP] Help with Sessions Hi, Saturday, March 1, 2003, 1:54:24 AM, you wrote: PKI> Hi PKI> I just have a little problem with sessions. PKI> my code: PKI> <htmL> PKI> <head><title>TEST</title> PKI> </head> PKI> <body> PKI> <?php PKI> session_start(); PKI> if ($submit) { PKI> echo 'Hello '.$_SESSION['ID']; PKI> } else { PKI> $_SESSION['ID']=2; PKI> echo "<form>\n"; PKI> echo "<input type=submit name=submit>\n"; PKI> echo "</form>\n"; PKI> } ?>> PKI> </body> PKI> </html> PKI> my error msgs: PKI> Warning: Cannot send session cookie - headers already sent by (output PKI> started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6) in PKI> d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8 PKI> Warning: Cannot send session cache limiter - headers already sent (output PKI> started at d:\apache_docroots\internal.infomart.ca\infodesk\test.php:6) in PKI> d:\apache_docroots\internal.infomart.ca\infodesk\test.php on line 8 PKI> Can anyone please help? Thanks.... move session_start() to the first line in your file -- regards, Tom

« previous php.general (#137582) next »