Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function checkPasswd($passwd, $user) {
- $authenticated = false;
- if($fh = fopen('passwd.txt', 'r')) {
- while(!feof($fh)) {
- $line = trim(fgets($fh));
- $account = explode(':', $line);
- if(count($account) == 2) {
- list($username, $password) = $account;
- if($username == $user && $password == $passwd) {
- $authenticated = true;
- }
- }
- }
- fclose($fh);
- }
- return $authenticated;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement