The page will not redirect IE9 but works in Chrome and IE 11. The code should show text and an error message when the user clicks the login button without completed credentials. The page sticks to the URL http://xxx.xxx.com/customer.php?action_nm=custlogin and will not respond to the following code.
Is there any known issue that IE9 and below does that causes a redirect not to work in PHP?
if(!empty($_POST["email"])){
$_SESSION["Email"] = $_POST["email"];
redirect("customer.php?action_nm=custlogin&action=xpwd");
exit;
}
else
{
redirect("customer.php?action_nm=custlogin&action=nocredentials");
exit;
}
}
this is the funcition below:
function redirect($s){
echo '<script language="JavaScript">
function redir() { document.location="'.$s.'"; }
console.log("' . $s . '")
redir();
</script>';
}