php header("location: test.php") not working. But java script redirect working
<blockquote>
  <p><strong>php header("location: test.php")</strong></p>
</blockquote>

<p>not working. But java script redirect working .</p>

<p>I tried with header() doesn't redirects?</p>

<blockquote>
  <p><strong>header("location: test.php");</strong></p>
</blockquote>

<p>but i tried with java script its working</p>

<blockquote>
  <p><strong>window.location ="http://www.test.com/test.php"</strong></p>
</blockquote>

<p>what is the problem. please give some solution</p>

<p>before calling header there no <strong>echo</strong> ( output commands )</p>

<p>there is no error / warning  messages</p>

<p><strong>My exact code :</strong></p>

<pre><code>if($contlogin &gt;0 &amp;&amp; $LoginID!="")
{      
    $_SESSION['LoginID'] = $LoginID;
    if($_SESSION['currentUrl']) {
        header("location: http://".$_SESSION['currentUrl']);
    }
    else {
        if($LoginID==1) {
            header("location:admin/index.php");
        }
        else {
            header("location:dashboard.php");
        }
    }
}
else {   
    header("location:index.php?err=1");
}
</code></pre>
