require ("members_only/api/api.php");
function ShowForm($status){
?>
if (!$status) print "Members Only Login";
else print "Login Failure";
?>
include("toc.html");
if (!$status) print "Please login for access to the Members Only section.
";
else print "Login failure: Please try again.
If you continue to have problems logging into this section please contact the
adminoffice@csma.info for assistance.
";
?>
}
if (isset($uname)){
header("Location:members_only/questions.htm");
}
if (!isset($_POST['username'])){
$error = 0;
ShowForm($error);
}
else {
$id = login($_POST['username'], $_POST['password']);
if ($id){
setcookie("userid",$id,time()+3600, "/");
setcookie("uname",$_POST['username'],time()+3600, "/");
header("Location:members_only/questions.htm");
}
else {
$error = 1;
ShowForm($error);
}
}
?>