<?php
  
// Erstes Mal dass die Seite geladen wird?
  
if (isset($_POST["txtUser"])) {
    
$user = $_POST["txtUser"];
    
$pw = $_POST["txtPW"];
    
$ErrorMsg = "";
    if ((
$user == "admin") && ($pw == "666"))
      
header('Location: ex9b.html');
    else
      
$ErrorMsg = "Login falsch";
  }
// if
?>
<html>
<body>
<h2>Login</h2>
<form name="form1" method="post" action="ex9.php">
  <table width="200px" border="0" bgcolor="#99FFFF">
    <tr>
      <td width="100px">Username:</td>
      <td width="100px">
        <input name="txtUser" type="text" size="10">
      </td>
    </tr>
    <tr>
      <td>Passwort:</td>
      <td><input name="txtPW" type="password" size="10">
    </tr>
    <tr>
      <td><input type="submit" value="Login"></td>
      <td><font color="red"><?php echo $ErrorMsg ?></font></td>
  </table>
</form>
</body>
</html>