Adding PHP Login to Admin Page

I made some modifications to the following script:

http://www.php-editors.com/articles/php_textfile.php

Now when a user is added to the textfile, the password is encrypted. Now I want to create a login page that accesses this textfile and looks for a match. I have a PHP script that is similar (login.php), but needs to be modified to work with the data as written by the admin page. Can someone take a look and tell me how to access the textfile data by $clientname (I think).

PS: I guess the title of this thread should be “Adding a PHP Login page (already have Admin page)”