Re: session related

From: Date: Fri, 11 Jan 2002 14:30:38 +0000
Subject: Re: session related
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-80199@lists.php.net to get a copy of this message
Probably 1)You do echo before session_start() 2)You have white space before the opening <?php tag The problem is in that that the server had sent some output to the browser and after that you want to sent a header - the session cookie. No output must appear before all headers are sent. You can suppres echo's to be sent to the browser with ob_start() as the furst instructuion in the Php, and ob_end() after the last header is sent. Regards, Andrey Hristov ----- Original Message ----- From: "Mark Chin, Apoll Displays" <mchin@apollodisplays.com> To: <php-general@lists.php.net> Sent: Thursday, January 10, 2002 11:00 PM Subject: [PHP] session related > i can't use session, give me an error when use ie 6. > > Warning: Cannot send session cookie - headers already sent by (output > started at /home/www.apollodisplays.com/public_html/mainpage.php:10) in > /home/www.apollodisplays.com/public_html/mainpage.php on line 29 > > Warning: Cannot send session cache limiter - headers already sent > (output started t > /home/www.apollodisplays.com/public_html/mainpage.php:10) in > /home/www.apollodisplays.com/public_html/mainpage.php on line 29 > > > my code is very simple. see below ----> > > session_start(); > session_register("userright"); > $HTTP_SESSION_VARS["userright"]=$right; > > anyone have any idea ? thankx > > > > > _____ > > Mark Chin <mailto:mchin@apollodisplays.com> > Apollo Display Technologies, LLC > 85 Remington Blvd. Ronkonkoma, NY 11779 > Ph. (631) 580-4360 EXT 19 > Fax (631) 580-4370 > http://www.apollodisplays.com > >

« previous php.general (#80199) next »