<?php
if(isset($_POST['user']) && isset($_POST['haslo'])){
  if($_POST['user'] == 'user1' && $_POST['haslo'] == 'pass1'){
    header("Location: glowna.php");
    exit();
  }
}
?>

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Moja strona WWW</title>
  </head>
  <body>
    <div>
      <form action = "http://localhost/index.php"
            method = "post">
        <table>
          <tr>
            <td>Użytkownik:</td>
            <td>
              <input type="text" name="user">
            </td>
          </tr><tr>
            <td>Hasło:</td>
            <td>
              <input type="password" name="haslo">
            </td>
          </tr><tr>
            <td colspan="2" style="text-align:center">
              <input type="submit" value="Wejdź">
            </td>
          </tr>
        </table>
      </form>
    </div>
  </body>
</html>
