Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function authenticate_user($login, $password, $key)
- {
- $val = set_codes();
- $query = "select * from users where login='$login' and password = encode('$password', '$key')";
- $result = mysql_query ($query);
- $row = mysql_fetch_row($result);
- if (mysql_num_rows($result) > 0)
- {
- $_SESSION['auth'] = $val;
- $_SESSION['id'] = $row[0];
- }
- else
- {
- $_SESSION['auth'] = "Incorrect Login";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement