Why heder('Location:index')not working but window.location.href='index.php' is working?
<p>I have the Index file like this</p>

<pre><code>&lt;?php
include('file1.php');
include('file2.php');
?&gt;
</code></pre>

<p>in file1.php I am having the code like below.</p>

<pre><code>&lt;?php
echo "hai";
?&gt;
</code></pre>

<p>I am trying to redirect the page by using <code>header('Location:index.php')</code>.It throws an error something like the output already started.I know for header if we give the echo statement it throws an error.In this situation I am trying to redirect by using Javascript <code>window.location.href='index.php'</code> .It gives me the expected output and there is no error.Why?.</p>
