using mysql as database. I got this code from the previous answers to the same question:
session_start()):
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
echo "Welcome to the member's area, " . $_SESSION['username'] . "!";
} else {
echo "Please log in first to see this page.";
}
Could you please explain what is: $_SESSION[‘loggedin’] .
Where could I define it? the loggedin, please help
You use sessions to store userdata to pass it between all pages that get loaded. You can define it as said by others by using the
$_SESSION['sessionname']var.I will post a simple script below how to let people login on the website since you wanted to know how to use it:
This is a simple script how to use a Session for a login system. There are many other ways you can use sessions