Hello all,
I am very new to php, I just started learning is this week. I need to make a secure login, which I thought I was close to doing, however it is not working out. I have attemtped to use cookies for authentication, but that ended up being too confusing, since it would not read the cookie input properly. So I decided to switch to sessions and I haven't had much more luck.
Here is what I have after the login info is accepted:
$_SESSION['logged_in'] = true;
Here is the page it sends you to that should check if you are logged in.
<?php
if (!isset($_SESSION['logged_in']))
{
echo"failed";
header("Location: fail.html");
}
else
{
echo("loaded<br>");
}
?>
<html>
<head>
<Title>Control Panel
</Title>
</head>
<body>
This is my control panel <BR>
test<br>
</body>
</html>
It sends me to the fail.html whether or not I go directly to index.php or use the login process. Any help would be much appreciate. I am new so please be polite.