Setcookie statement, read the setcookie statement, and the error message is: Warning: Cannotmodifyheaderinformation-headersalreadysentby. Solution: open php_ini, search output_bufferfing, and remove the semicolon, change off to on
Error message:
Warning: Cannot modify header information-headers already sent
Solution:
Open php_ini, search for output_bufferfing, remove the semicolon, change off to on, or set a value. You can.
This is because of the setcookie statement.
There are some restrictions on the use of cookies, such:
1. call setcookie? Required? Before the tag
2. you cannot use echo before calling setcookie.
3. ?? Re-created? What is the cookie? In the program?
4. is the setcookie function required? In any? Expected? Before exiting the browser, send
5 .......
Based on the above? Some restrictions, so? When the row setcookie () function is used, usually? Encounter "Undefined index", "Cannot modify header information-headers already sent "... ??, Solution ?" Cannot modify header information-headers already sent by "this ?? The method is to delay the cookie before it is generated? To the browser. Therefore, you can add ob_start (); to the front of the program ?. This will solve the problem.