Hello readers. On developing the website the error 'Header already sent' is very likely to occur.
This is cause by PHP when it receives outputs like echo or html tags now it can take the data but then further passing it to HTTP will be very difficult
And you'll see the error
Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:12) in /some/file.php on line 23
So you can remember to avoid this error by doing some corrections in your code.
- Whitespace before <?php or after ?>
2.<?php # There's a SINGLE space/newline before <? - Which already seals it.
OR
If you have error reporting on then set the code as below
error_reporting(E_ALL);
ini_set("display_errors", 1);
0 Comment(s)