i have some code to redirect a user to a page if their login details are correct. part of the code is as below but it never redirects to the specified page. help me sort this out
if($pass==$dbpass){
//safely redirect user to the home page and start a new session
session_start();
$_SESSION['userid'] = $userid;
$_SESSION['logged'] = TRUE;
echo "<script language = 'javascript'>window.location = 'createaccount.html';</script>";
//header("location:home.php");
} else {
//user input and stored input did not match
echo "Invalid Password";
}