<? if(!isset($b)) { form(); } else { if(($_POST["b"] == "Haavard" && $_POST["p"] == "bo") OR ($_POST["b"] == "Mathias" && $_POST["p"] == "bo")) { session_register("b", "p"); ?> <html> <head> <title>Du er logget inn</title> <link rel="stylesheet" href="../css/basic.css"> </head> <body> <hr> <h1>Du er nå logget inn, <?php echo $_POST["b"]; ?></h1> <hr> <h2><a href="medlemsider.php" title="Medlemsider">Trykk Her</a></h2> <br> <a href="<? echo "$PHP_SELF?login=logout&check=yes"; ?>" title="Logout?"> Log out </a> </body> </html> <?php } else { //echo "du er ikke logget inn"; echo "Sorry, your username or password was incorrect, please try again."; } } function form() { global $PHP_SELF; ?> <p> </p> <p> </p> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td width="100%"> <p align="center"><font face="Courier"><b>Admin Login:</b></font></td> </tr> </table> <form method="POST" action="<?=$PHP_SELF?>"> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td width="32%"> </td> <td width="11%"><font size="2" face="Courier New">Username:</font></td> <td width="60%"><font size="2"> <input type="text" name="b" size="20" style="font-family: Courier New; font-size: 8pt; border: 1px solid #FFFFFF; background-color: #C0C0C0"> </font></td> </tr> <tr> <td width="32%"> </td> <td width="11%"><font size="2" face="Courier New">Password:</font></td> <td width="60%"><font size="2"> <input type="password" name="p" size="20" style="font-family: Courier New; font-size: 8pt; border: 1px solid #FFFFFF; background-color: #C0C0C0"></font></td> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"> <tr> <td width="43%"> </td> <td width="11%"> <input type="submit" value="Submit" name="B3" style="font-family: Courier New; font-size: 8pt; border: 1px solid #FFFFFF; background-color: #C0C0C0"></td> <td width="46%"> <input type="reset" value="Reset" name="B4" style="font-family: Courier New; font-size: 8pt; border: 1px solid #FFFFFF; background-color: #C0C0C0"></td> </tr> </table> </form> <?php } if(isset($login)) { function logout() { global $ub, $p, $PHP_SELF, $check; if($check == "yes") { session_unregister("p"); session_unregister("b"); echo "<p align=\"center\"><b>You have successfully logged out</b></p>"; echo "<p align=\"center\"><a href=\"index.php\" style=\"text-decoration: none\">"; echo "<font color=\"#071378\">Please click here to return to index.php.</font></a></p>"; } else { echo "<h2>UNKNOWN URL</h2>"; } } switch ($login) { case "logout": logout(); break; } } ?>