this is prolly more then you asked for
It starts off by opening the filename stored in the $password_file variable.
It sets $match to zero and md5() the password. If you are using this code,
it would probably be best to use something like $_REQUEST['password'] to
get your password and $_REQUEST['username'] to get your username. The above
code you provided will probably give you an error if you don't have global
variables = on.
It will loop through the file with the while(!feof($fh)) loop. this will
continue to loop until it reaches the end of the file. It reads in one
line at a time and then explodes the line into the array $user_pass based
on the ':' delimiter. It will test to see if the $username is equal to
the first element (element 0) in this newly created $user_pass array, and
if it is, it will test to see if the password is equal to the trimmed value
of the 2nd element (element 1). If both username and password match, it
sets $match to 1 and breaks out of the loop. If they are not, it will read
in the next line of the file, explode it into the array, and start the check
all over again.
After the loop, it just checks match. If match is 1, it returns on, if it
is not, it returns zero. This code can be sumed by saying:
Since match is either 0 or 1, and it returns either a 0 or 1, you mise well
return $match and save yourself a test.
And it's probably good to put a fclose() after your while loop to close
your file. And good practice not to assume global variables are set to on,
so I'd recommend using $_REQUEST, $_POST, or $_GET to refer to your variables
you pass from other pages.