if($row['psw']===$passwordphp)
{
echo '<script language="javascript">';
echo 'alert("LOGIN SUCCESSFULL")';
echo '</script>';
header("Location: registration.php");
}
else{
echo '<script language="javascript">';
echo 'alert("CHECK EMAIL OR PASSWORD")';
echo '</script>';
header("Location: login.php");
}
Here is the code. If I don't add header then JavaScript runs but when I add header Javascript stop running only executes the header function. Why is so? How can make both of them work properly?