Page Security

<?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');
?>
<style> *{font-family:sans-serif;}.moosebutt { background-color: #369; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #000; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; background-image: url(images/button_bg_over.jpg); }.moosetext { background-color : #eee; border: 1px solid #369; width: 230px; } </style>
<?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 == "{{ username }}") && ($password == "{{ 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="{{ page }}" method="post">
<Center><table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr><td>U</td><td><input class="moosetext" type="text" name="login" value="<?php echo $login ?>"></td>
<tr><td>P</td><td><input class="moosetext" type="password" name="password" value="<?php echo $password ?>"></td>
<tr><td><td><input class="moosebutt" type="submit" name="action" value="Login"></td>
</tr></table></form>
<?php
}
if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
return $_SESSION["logged_in"];
}
if (!login()) exit;
?>
<style>.moosebutt { background-color: #f00; padding-left:6px; padding-right:6px; padding-top:3px; padding-bottom:3px; color: #ffffff; border:1px solid #db6600; background-image: url(images/button_bg.jpg); }.moosebutt:hover { background-color: #000000; border:1px solid #000000; color: #ffffff; } </style>

<a style="float:right" class="moosebutt" href="{{ page }}?a=logout">Logout</a>
<!-- End Page Security -->