<?Php
/*
* @author Istvan Franko
* @copyright 2014
*/
ob_start();
session_start();


if (!isset($_SESSION['loggedin'])) 
{
  $_SESSION['loggedin'] = '0'; 
}
?>

<html>

 
<head>
<title>Films</title>
<link rel="stylesheet" type="text/css" href="css/style.css" />
</head>

<body>

<div id="container">

	<div id="header">
	<! header picture in css >
	</div>
	
	<div id="navigation">
		<?php include 'navigation.php'; ?>
	</div>
	
<div id="content">

<?php

if(!empty($_POST)) {
	$password = $_POST['password'];
	if ($password == 'admin'){	
	$_SESSION['loggedin'] = '1';
	header('Location: films2.php');
} else {
	echo "password" , $password ,"<br/>";
	echo "Sorry, wrong password<br/>";
	echo "<hr /><a href=\"login.php\">Try again</a>";
	}
} else {
?>


<h1> Log-in</h1>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<input name="password" type="password" id="password" />
<input type="submit" name="Submit" value="Log-in" />
</form>

<?php
}
ob_end_flush();
?>

</div>

<div id="footer">
Copyright &#169; Istvan Franko, 2014
</div>
	

</div>
</body>
</html>
