hi -- not sure i understand exactly what you're doing, but i do notice that your if / else structure seems a bit off as far as i understand it. . . maybe:
<?php
if ($op == "login") {
$fp=fopen("passwords.txt", "a");
fputs($fp, $user, $pass);
fclose($fp);
echo "worked!";
}
else {
echo "didn't work";
}
?>