You are logged in as".$_SESSION['name']."";
header("Location:listreports.html");
} else
{
// include the FM-and-PHP headers
include("../fmphp/fmandphp.php");
include("../fmphp/config.php");
// what do we do now?
if (!ProcessLogin($FM))
PostLoginForm("");
}
// This is an error-tester
function TestError($FM)
{
if ( $FM->getErrorNumber() != 0) {
echo "error";
echo $FM->getErrorDescription();
}
}
// This function processes the POST input from the login form
function ProcessLogin($FM)
{
if (! (isset($_POST['name']) && isset($_POST['email'])))
// the login form was not used, do something else!
return false;
// The login form was used, let us process it
$name = trim($_POST['name']);
$email = trim($_POST['email']);
if (!(($name !="") && ($email!="")))
{
PostLoginForm("Name and email must not be empty!");
return true;
}
// everything ok, we log the user in!
$_SESSION['logged'] = true;
$_SESSION['name'] = $name;
$_SESSION['email'] = $email;
echo "
Thank you, ".$name."! ";
echo "Please follow this link to view the aviable reports!
";
return true;
}
// This function wites a login/register form
function PostLoginForm($error_message)
{
// user is not logged in, we want him to do so
// a form
echo "";
}
?>