How to fix “Headers already sent” error in PHP
This question already has an answer here:
This type of problem is caused when you use header after you write in your page. I assume you code might look like ::
<html>
<head>
<title> title </title>
.........
</head>
<body>
.....
<?php
header() // checking some header
?>
.....
</body>
</html>
If so, use header() before html
or any kind of echo or writing code. But this is not correct solutions. You can use ob_start
. This is the best solution. check this
上一篇: 标题已由Error发送