<?
if($_POST['submit'] == 1) {
$line = $_POST['user'] ."\t". md5($_POST['password'])."\n";
$handle = fopen('db.txt', "a");
fwrite($handle, $line)or die('Fehler beim Schreiben');
fclose($handle);
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="hidden" name="submit" value="1" />
<table>
<tr>
<td>Benutzername:</td>
<td><input type="text" name="user" /></td>
</tr>
<tr>
<td>Passwort:</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Registrieren" />
</td>
</tr>
</table>
</form>