0 votes
in Programming by

This error is coming when I am trying to run my php script


Warning: Cannot modify header information - headers already sent by (var/home/www/html/project /src/run.php:13) in src/run.php on line 33


And these lines 13 and 33 contains header() and setcookie() function.


can you please tell me the solution and reason as well as.


2 Answers

0 votes
by (140 points)
Quick fix is to wrap the code with ob_start(). Error means that you are prematurely sending output to the browser
0 votes
by Expert (5.1k points)

remove the white spaces in your file after the php closing tag i.e ?>, php tags must be close properly ,  or you can remove the php closing tag and remain it open server will close it by itself.

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated