<?php
session_start();
$usererror = "";
$passerror = "";

if (isset($_POST['submit'])) {
    $user = "admin";                  // change username
    $pass = "gh3dgue7sber";           // change password
    $page = "secretpage.php";         // change secretpage

    $username = $_POST['username'];
    $password = $_POST['password'];

    $u_proceed = ($username == $user) ? "1" : "0";
    if ($u_proceed == "0") $usererror = "Wrong username !!!";

    $p_proceed = ($password == $pass) ? "1" : "0";
    if ($p_proceed == "0") $passerror = "Wrong password !!!";

    if ($u_proceed == "1" && $p_proceed == "1") {
        $_SESSION['loggedin'] = 1;
        header('Location: ' . $page);
        exit();
    }
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Simple Login System / myPHP.se</title>
</head>
<body>
<div align="center">
    <div style="width: 330px;">
        <h2>Easy Login System</h2>
        <form action="login.php" method="post">
            <input type="text" name="username" placeholder="Username" id="username" required><BR>
            <i style="color:blue"><?php echo $usererror; ?></i><BR>
            <input type="password" name="password" placeholder="Password" id="password" required><BR>
            <i style="color:blue"><?php echo $passerror; ?></i><BR>
            <input type="submit" value="Login" name="submit">
        </form>
    </div>
</div>
</body>
</html>