I am recently building a simple php login page with mysql. When I test my site on the localhost it works fine, however when I upload it to the server it cannot redirect to the following page and keep showing the same login page. I noticed that when I enter the login page chrome keeps warning me the site is not secure.
the following code is for redirecting the page after password comparison. Can some one help me with this problem? Thanks!
if (password_verify($_POST['password'], $hash)) {
$_SESSION['logged_in'] = 1;
$new = stripslashes($program);
header("location: $new.php");
}
else {
$_SESSION['message'] = "Wrong password, try again!";
header("location: error.php");
echo "fails";
}
}