5 include("include/session.php");
9 <title
>Jpmaster77
's Login Script</title>
18 * User has already logged in, so display relavent links, including
19 * a link to the admin center if the user is an administrator.
21 if($session->logged_in){
22 echo "<h2>Logged In</h2>";
23 echo "Welcome <b>$session->username</b>, you are logged in. <br><br>"
24 ."[<a href=\"userinfo.php?user=$session->username\">My Account</a>] "
25 ."[<a href=\"useredit.php\">Edit Account</a>] ";
26 if($session->isAdmin()){
27 echo "[<a href=\"admin/admin.php\">Admin Center</a>] ";
29 echo "[<a href=\"process.php\">Logout</a>]";
37 * User not logged in, display the login form.
38 * If user has already tried to login, but errors were
39 * found, display the total number of errors.
40 * If errors occurred, they will be displayed.
42 if($form->num_errors > 0){
43 echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";
46 <form action="process.php" method="POST">
47 <table align="left" border="0" cellspacing="0" cellpadding="3">
48 <tr><td>Username:</td><td><input type="text" name="user" maxlength="30" value="<? echo $form->value("user"); ?>"></td><td><? echo $form->error("user"); ?></td></tr>
49 <tr><td>Password:</td><td><input type="password" name="pass" maxlength="30" value="<? echo $form->value("pass"); ?>"></td><td><? echo $form->error("pass"); ?></td></tr>
50 <tr><td colspan="2" align="left"><input type="checkbox" name="remember" <? if($form->value("remember") != ""){ echo "checked"; } ?>>
51 <font size="2">Remember me next time
52 <input type="hidden" name="sublogin" value="1">
53 <input type="submit" value="Login"></td></tr>
54 <tr><td colspan="2" align="left"><br><font size="2">[<a href="forgotpass.php">Forgot Password?</a>]</font></td><td align="right"></td></tr>
55 <tr><td colspan="2" align="left"><br>Not registered? <a href="register.php">Sign-Up!</a></td></tr>
63 * Just a little page footer, tells how many registered members
64 * there are, how many users currently logged in and viewing site,
65 * and how many guests viewing site. Active users are displayed,
66 * with link to their user information.
68 echo "</td></tr><tr><td align=\"center\"><br><br>";
69 echo "<b>Member Total:</b> ".$database->getNumMembers()."<br>";
70 echo "There are $database->num_active_users registered members and ";
71 echo "$database->num_active_guests guests viewing the site.<br><br>";
73 include("include/view_active.php");