<?php
$users = array("user1", "user2", "user3");
$pass = array("pass1", "pass2", "pass3");

if(isSet($_POST['user']) && isSet($_POST['haslo'])){
  foreach($users as $key => $val){
    if($_POST['user'] == $val && $_POST['haslo'] == $pass[$key]){
      header("Location: glowna.php");
      exit();
    }
  }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<title>Logowanie użytkowników</title>
</head>
<body>
<div>
<form action = "http://localhost/index.php"
      method = "post"
>
<table border="0"><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" align="center">
  <input type="submit" value="Wejdź" />
</td>
</tr></table>
</form>
</div>
</body>
</html>