There are a 101 different ways of going about what you need.
This is my 2 cents
If your not interested in coding your own authentication system etc, the go with the suggestion killerbishop made.
If you do want to code you own system, you have to decide how paranoid you ae about security.
For example I wouldnt suggest using text files, somebody may guess the name of your file and hey presto they have your user pass.
I personally would create a simple login table in an sql db, store the username in plain text and the password in md5 - then you right a script to take the submission from a logon form and compare the submitted values agasint the db (obviously converting the submitted password to md5 before comparison)
And example of the code might be something like this
if ($submit)
{
//get sql data here
if (md5($password) == sql_data["password"])
{
$passwordcheck = true;
}
if ($username == sql_data["username"])
{
$usernamecheck = true;
}
if (($passwordcheck) && ($usernamecheck))
{
$authenticated = true;
//do whatever here, maybe punp $authenticated into a session
//vars
}
else
{
print "Intruder Alert";
exit;
}
Note : I just wrote that code in like 20 seconds as an example, it prolly loaded with typos, but at least you get the idea I hope