php header("location: test.php")
not working. But java script redirect working .
I tried with header() doesn't redirects?
header("location: test.php");
but i tried with java script its working
window.location ="http://www.test.com/test.php"
what is the problem. please give some solution
before calling header there no echo ( output commands )
there is no error / warning messages
My exact code :
if($contlogin >0 && $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");
}