<?php session_start();
ini_set('error_reporting', E_ALL | E_STRICT);
ini_set('display_errors', 'Off');
ini_set('log_errors', 'Off');
ini_set('error_log', '/path/to/error_log');
?>
<html>
<head><title></title>
</head>
<?php
if (!login()) exit;
?>
<?php function login(){
global $_POST;
global $_SESSION;
global $_GET;
if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
if (!$_SESSION["logged_in"]) {
$login = "";
$password = "";
if (isset($_POST["login"])) $login = @$_POST["login"];
if (isset($_POST["password"])) $password = @$_POST["password"];
if (($login != "") && ($password != "")) {
if (($login == "") && ($password == "")) {
$_SESSION["logged_in"] = true;
}
else {
?>
<p><center><b><font color="#000000">Sorry, Wrong. Try Again.</font></b></p>
<?php } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
<form name=FearDeargData action="" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td>Username</td>
<td><input type="text" name="login" value="<?php echo $login ?>"></td>
<td>Password</td>
<td><input type="password" name="password" value="<?php echo $password ?>"></td>
<td><input type="submit" name="action" value="Login"></td>
</tr>
</table>
</form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
} ?>
<br>
*********************************Paste Secure stuff below**********************************************************
<?php
if (!login()) exit;
?><div style="float: right"><span class="op02 "><a href="?a=logout">Logout</a></span></div>