|
PHP Tutorial-Alt Code Documentation
Documentation of PHP Tutorial-Alt Code by Doxygen
|
PHP header modifiers like session_start() must be placed before the html tag.
PHP header modifiers, like setcookie(), session_start(), and header(), MUST appear before any HTML output is triggered. Otherwise, the server will send the headers before the PHP header modifiers are processed, which causes failures with messages like "Warning: Cannot modify header information."
So, place PHP header modifiers before the html tag. They can be placed, along with any globabl variables they will use, at the very top of the source code, even before the DOCTYPE tag.