Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function _validUser($userName, $userPassword) {
- $file = file('users.txt');
- foreach ($file as $value) {
- $line = explode("@", $value);
- if ($line[1] == trim($userName) && trim($line[2]) == trim($userPassword)) {
- $_SESSION['_logged'] = true;
- $_SESSION['_userID'] = (int) $line[0];
- $_SESSION['_userName'] = $line[1];
- $_SESSION['_success'] .= 'Успешен вход !';
- break;
- }
- }
- if (!$_SESSION['_logged'] == true) {
- $_SESSION['_error'] = 'Грешна парола или потребител !';
- return (bool) 0;
- } else {
- return (bool) 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment