if ($loggedin) {
// user is logged in, lets setup some session vars for use in our scripts
$_SESSION['LOGGEDIN'] = true;
$_SESSION['USERNAME'] = $_REQUEST['username'];
$_SESSION['PASSWORD'] = $_REQUEST['password'];
include 'include.php';
if ($loggedin) {
// user is logged in, lets setup some session vars for use in our scripts
$_SESSION['LOGGEDIN'] = true;
$_SESSION['USERNAME'] = $_REQUEST['username'];
$_SESSION['PASSWORD'] = $_REQUEST['password'];
$_SESSION['SERVER'] = $_REQUEST['domain'];
include 'include.php';
} else {
// use did NOT log in successfully (or something went wrong), you might want a message here
// saying that they did not login correctly
$_SESSION['LOGGEDIN'] = false;
echo "login failed";
}
} else {
// use did NOT log in successfully (or something went wrong), you might want a message here
// saying that they did not login correctly
$_SESSION['LOGGEDIN'] = false;
include ( 'loginfailed.php');
}
Welcome back <?php echo $_SESSION['USERNAME']; ?>
<?php
if ( isset ( $_SESSION['USERNAME'] ) )
{
// TO DO: Logged in
}
else
{
// TO DO: Login Form
}
?>
if ( $_REQUEST['page'] == 'logout' ) // or whatever
{
session_write_close();
}