Will someone make such an error? Error message: Warning: & nbsp; session_start () & nbsp; [function. session-start]: & nbsp; Cannot & nbsp; send & nbsp; session & nbsp; cookie & nbsp;-& nbsp; headers & nbsp; will someone make a mistake like?
The error message is:
Warning: session_start () [function. session-start]: Cannot send session cookie-headers already sent by (output started at/www/web/jiayiblog_com/public_html/buy. php: 2) in/www/web/jiayiblog_com/public_html/buy. php on line 2
Warning: session_start () [function. session-start]: Cannot send session cache limiter-headers already sent (output started at/www/web/jiayiblog_com/public_html/buy. php: 2) in/www/web/jiayiblog_com/public_html/buy. php on line 2
Warning: Cannot modify header information-headers already sent by (output started at/www/web/jiayiblog_com/public_html/buy. php: 2) in/www/web/jiayiblog_com/public_html/buy. php on line 58
The error is like this, and the code of buy. php is:
Ob_start ();
$ Parray = $ _ SESSION ["mycar"];
?>
Include_once ("functions/databaseconnection. php ");
$ Arr = array ();
$ Name = $ _ GET ["name"];
$ Con = "select * from allproduct where name = '$ name '";
GetConnection ();
$ Result = mysql_query ($ con );
While ($ result1 = mysql_fetch_array ($ result )){
$ Arr [] = $ result1;
?>
Why? Could you please help me? is it the question of session_start? You are in trouble.
------ Solution --------------------
The session must be at the beginning
------ Solution --------------------
Put session_start to the first line.
------ Solution --------------------
This problem occurs: session_start (); must be before output.
Changed to this:
Session_start ();
?>
------ Solution --------------------
Session_start ();
No output before
Header is also
The BOM in UTF8 format does not work either.
------ Solution --------------------
Before the first line of the program
Ob_start ();
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.