<?php


session_start();

if (isset($_POST['login']) && isset($_POST['pass']) && $_POST['login'] == "constans" && $_POST['pass'] == "arz123@#!") {
	$_SESSION['logged'] = true;
}

if (isset($_SESSION['logged'])) {
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Panel Administracyjny</title>
</head>
<body>
<?php

    echo "zalogowany";
/*include('config.php');

$con = mysqli_connect($host, $user, $pass, $base);
if (mysqli_connect_errno()) die (mysqli_connect_error());

if (!$con->set_charset("utf8")) {
	printf("Error loading character set utf8: %s\n", $mysqli->error);
}

 */

?>
</form>
</body>
</html>
<?php
} else { 
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Panel Administracyjny</title>
</head>
<body>
<form action="./admin.php" method="post">
Login: <input type="text" name="login" /><br />
Hasło: <input type="password" name="pass" /><br />
<input type="submit" value="Zaloguj"/>
</form>
</body>
</html>
<?php
}
?>
