title: Bootstrap Cannot modify header information
body: <p>I try to do a notification system , that play a sound each time some one make a new post.
  I am work in boostrap 4
  I have chnge the way to do it by insert a javascript in the functions page but wen i call the javascript function give me all ways the same error of before
  I go to post only part of all the code because is dimention
  The sctipt i call is play_sound
  and i call in an echo like this</p>
  <pre><code>echo '&lt;script type=&quot;text/javascript&quot;&gt;play_sound();&lt;/script&gt;';
  </code></pre>
  <p>and i get same error then before</p>
  <pre><code>This is my error
  </code></pre>
  <blockquote>
  <p>Warning: Cannot modify header information - headers already sent by (output started at /home/nicetaxi/public_html/helpers/Functions.php:1) in /home/nicetaxi/public_html/helpers/Functions.php on line 208</p>
  <p>This is the line of my error</p>
  </blockquote>
  <pre><code>function redirect_to_page($path = null)
  {
  header(&quot;location:&quot; . SITE_ADDR . $path);
  }
  
  How can i solve this error
  
  This is the functions page
  
  &lt;script type=&quot;text/javascript&quot;&gt;
  function play_sound() {
      var audioElement = document.createElement('audio');
      audioElement.setAttribute('src', 'https://www.nicetaxi.eu/download/notifications.mp3');
      audioElement.setAttribute('autoplay', 'autoplay');
  audioElement.setAttribute('muted', 'muted');
      audioElement.load();
      audioElement.play();
  }
  &lt;/script&gt;
  &lt;?php
  </code></pre>