Associate
- Joined
- 2 Sep 2007
- Posts
- 2,001
Hi All, I'm back. 
I want to create a very simple login process. There will only be one user so I won't need to authenticate with a database. I know I need to create a simple form with two textboxes and a button.
How do I setup the session variables in my validatelogin.php?
I've found this code on this forum which I can use in my pages which I need to secure: -

I want to create a very simple login process. There will only be one user so I won't need to authenticate with a database. I know I need to create a simple form with two textboxes and a button.
How do I setup the session variables in my validatelogin.php?
I've found this code on this forum which I can use in my pages which I need to secure: -
Code:
if($_SESSION['username'] === "username" && $_SESSION['password'] === "password") {
session_regenerate_id();
$logged_in = 1;
} else {
$_SESSION = array();
session_destroy();
header("Location: index.php");
}