I am doing a project and i want to have a text file with usernames and passwords like

john 12345
nick 56780
taki 9087

and i will put a login form so the user will type the username and password and through the text file, the program will check the information and then login. So i want some help how to write the code to check this information when the user type them.