there are several ways of doing this,
for sanity purposes, i would suggest if you could to use a mysql table, makes this more simple, but if you want to do a simple compare variables, do this:
$user1 is the username in the text file
$pass1 is the text password
$name is the submitted username
$pw is the submitted password
if (($name == $user1) AND ($pw == $pass1))
echo "Loggedin, or whatever you want here";
but check out this article, because this isnt the most secure way to do things. :
http://www.phpbuilder.com/columns/tim20000505.php3