This question has already been answered:

I wrote a script to reload the page:

header('Location:lottery.php');//строка 82 exit; 

An error popped up - Warning: Cannot modify header information - headers already by (output started by V: \ home \ mySite \ www \ lottery.php: 204)

line 204, as in the error:

 <script type='text/javascript' src='script.js'></script> 

spaces before <? No, I searched 100,500 times ...

Reported as a duplicate by participants of Grundy , Visman , user207618, Sasha Chernykh , 12 Mar '18 at 19:16 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • You are sending content before the header, which is not allowed. - user207618
  • @Other like that? I want to load a page after clicking a button - shumik_UA
  • @shumik_UA, Read the duplicate, it describes how to avoid this problem. - user207618 2:07 pm

1 answer 1

This error pops up when there is some kind of output before header (). If it is line 82, then the output can be anywhere. Here, without a variant, a character, a space, html code gets on the page, maybe some headers have already been sent. Try to exit; before line 82 and ctrl + U to see the source code that hits the page. For a normal page reload, it must be completely empty.