Re: Session and header() errrors

From: Date: Thu, 04 Oct 2001 11:18:53 +0000
Subject: Re: Session and header() errrors
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-69914@lists.php.net to get a copy of this message
You should change sessions configuration in php.ini The default value for sessions dir /tmp. In windows shoud point to c:\tmp The header error occurs because you get a warning about session. ----- Original Message ----- From: "Web user" <random11@telekbird.com.cn> To: <php-general@lists.php.net> Sent: Thursday, October 04, 2001 11:51 AM Subject: [PHP] Session and header() errrors > Why do the errors occur while running the scripts below? It seems that the > errors occured at the part of session and header(). Please give me some > advice! > Thank you! > > Mike > > System: PHP4.06 + Apache 1.3.20 Win32 + Win98 (the session configurations > are default in php.ini) > > when the 1.php is running, the IE shows errors info as below : > ----------------- > Warning: Cannot send session cookie - headers already sent by (output > started at c:\program files\apache group\apache\htdocs\web1\html-head.inc:9) > in c:\program files\apache group\apache\htdocs\web1\1.php on line 3 > > Warning: Cannot send session cache limiter - headers already sent (output > started at c:\program files\apache group\apache\htdocs\web1\html-head.inc:9) > in c:\program files\apache group\apache\htdocs\web1\1.php on line 3 > > Warning: open(/tmp\sess_96ae897bcb501486860552d2df862863, O_RDWR) failed: m > (2) in c:\program files\apache group\apache\htdocs\web1\1.php on line 3 > session_id: 96ae897bcb501486860552d2df862863 > > > Warning: Cannot add header information - headers already sent by (output > started at c:\program files\apache group\apache\htdocs\web1\html-head.inc:9) > in c:\program files\apache group\apache\htdocs\web1\1.php on line 9 > > ------------- > The scripts of 1.php: (1.php and 2.php are under the same base directory) > <? > require("html-head.inc"); > session_start(); > $name="user"; > session_register("name"); > echo "session_id: ".session_id()."<br>"; > sleep(10); > header("Location: 2.php"); > require("html-foot.inc"); > ?> > > ----- > The scripts of html-head.inc: > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; > charset=ISO-8859-1"> > <title>page title</title> > </head> > <body> > > ----- > The scripts of html-foot.inc: > </body> > </html> > > > > > > > > > > -- > 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 > >

« previous php.general (#69914) next »