RE: [PHP] Session Problems....HELP!!!!
Just move these two lines to the beginning of the file: session_start(); session_register(test); These have to be before any output is sent to the browser. Kirk -Original Message- From: Bruno Freire [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 03, 2001 2:42 PM To: '[EMAIL PROTECTED]' Subject: [PHP] Session ProblemsHELP Hi! my name is bruno, from Brazil and i'm having some problems with sessions. Look my code: html head ... /head body ?php session_start(); session_register(test); ? /body /html The message returned in my browser is: Warning: Cannot send session cookie - headers already sent by (output started at /home/httpd/html/intranet/teste.php:11) in /home/httpd/html/intranet/teste.php on line 12 Warning: Cannot send session cache limiter - headers already sent (output started at /home/httpd/html/intranet/teste.php:11) in /home/httpd/html/intranet/teste.php on line 12 !-- A { text-decoration: none; } A:hover { text-decoration: underline; } H1 { font-family: arial,helvetica,sans-serif; font-size: 18pt; font-weight: bold;} H2 { font-family: arial,helvetica,sans-serif; font-size: 14pt; font-weight: bold;} BODY,TD { font-family: arial,helvetica,sans-serif; font-size: 10pt; } TH { font-family: arial,helvetica,sans-serif; font-size: 11pt; font-weight: bold; } //-- What's wrong??? Maybe the PHP's configuration file... Or some command is needed first Please, if somebody know the solution...help me. Thanks. Bruno -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Session Problems....HELP!!!!
the session_start() should be placed at the top, before the HTML ?php session_start(); ? html head ... ?php session_register(test) ... Nikhil Bruno Freire [EMAIL PROTECTED] wrote in message 454D444FF5C0D211891800A0C98C7D90359A54@SERVIDOR">news:454D444FF5C0D211891800A0C98C7D90359A54@SERVIDOR... Hi! my name is bruno, from Brazil and i'm having some problems with sessions. Look my code: html head ... /head body ?php session_start(); session_register(test); ? /body /html The message returned in my browser is: Warning: Cannot send session cookie - headers already sent by (output started at /home/httpd/html/intranet/teste.php:11) in /home/httpd/html/intranet/teste.php on line 12 Warning: Cannot send session cache limiter - headers already sent (output started at /home/httpd/html/intranet/teste.php:11) in /home/httpd/html/intranet/teste.php on line 12 !-- A { text-decoration: none; } A:hover { text-decoration: underline; } H1 { font-family: arial,helvetica,sans-serif; font-size: 18pt; font-weight: bold;} H2 { font-family: arial,helvetica,sans-serif; font-size: 14pt; font-weight: bold;} BODY,TD { font-family: arial,helvetica,sans-serif; font-size: 10pt; } TH { font-family: arial,helvetica,sans-serif; font-size: 11pt; font-weight: bold; } //-- What's wrong??? Maybe the PHP's configuration file... Or some command is needed first Please, if somebody know the solution...help me. Thanks. Bruno -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Session Problems....HELP!!!!
If you don't use output buffering, the session stuff has to be the first thing in you script. In other words, you should not send anything to the browser before the session functions. In your case you are sending html tags to the browser before the session functions. Rewrite it as the following: ?php session_start(); session_register(test); ? html head ... /head body /body /html -Original Message- From: Bruno Freire [mailto:[EMAIL PROTECTED]] Sent: Thursday, May 03, 2001 4:42 PM To: '[EMAIL PROTECTED]' Subject: [PHP] Session ProblemsHELP Hi! my name is bruno, from Brazil and i'm having some problems with sessions. Look my code: html head ... /head body ?php session_start(); session_register(test); ? /body /html The message returned in my browser is: Warning: Cannot send session cookie - headers already sent by (output started at /home/httpd/html/intranet/teste.php:11) in /home/httpd/html/intranet/teste.php on line 12 Warning: Cannot send session cache limiter - headers already sent (output started at /home/httpd/html/intranet/teste.php:11) in /home/httpd/html/intranet/teste.php on line 12 !-- A { text-decoration: none; } A:hover { text-decoration: underline; } H1 { font-family: arial,helvetica,sans-serif; font-size: 18pt; font-weight: bold;} H2 { font-family: arial,helvetica,sans-serif; font-size: 14pt; font-weight: bold;} BODY,TD { font-family: arial,helvetica,sans-serif; font-size: 10pt; } TH { font-family: arial,helvetica,sans-serif; font-size: 11pt; font-weight: bold; } //-- What's wrong??? Maybe the PHP's configuration file... Or some command is needed first Please, if somebody know the solution...help me. Thanks. Bruno -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]