Hi, im not too good at php, and i need some help

I got a memmo file on my server, where i write everything i need to remember(serials, tlf nr, etc) I dont have the opertunety to use ftp on my school and my work, so im trying to make a php script that alowes me to read and edit the file with php.
My problem is that i cant get the saving function to work proppely.
I want the whole script in one file. and i want the save action to not direcy me away from the txt file. (so that i can save, get a msg that says that it went ok, and then leave the page open until i need it nxt time..
accualy i think it dont save at all anny more:P i destroyed it when i tryed to fix it
memmo.php
<?php
$username = "ink";
$password = "pass";
if ($_POST['userlog'] != $username || $_POST['passlog'] != $password) {
?>
Login for Memmo.txt
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<label for="userlog">Username:</label>
<input type="text" title="Enter your Username" name="userlog">
<br><label for="passlog">Password:</label>
<input type="password" title="Enter your password" name="passlog">
<br><input type="submit" name="Submit" value="Login">
</form>
<?php
}
else {
?>
<?
$filename = "memmo.txt";
$fp = fopen ($filename, "rw"

;
echo "<form method=post action=motor.php>\n";
echo "<textarea rows='30' cols='100' name='content'>\n";
$content = fread ($fp, filesize ($filename));
echo $content;
echo "</textarea><br><br>";
fclose ($fp);
echo "<input type=submit value=Save>\n";
echo "</form>";
?>
<?php
}
?>
motor.php
<?php
$filename = "memmo.txt";
$fp = fopen ($filename, "w"

;
// write to file
if (!fwrite($fp, $_POST['content'])) {
echo "Unable to modify the file";
exit;
}
echo "<div align="center" valign="center"><p>Memmo.txt was updated succesfully.</p><p><a href="munchmoller.com/memmo/index.php>Back</a></p>< ;/div>" ;
fclose($fp);
?>