Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (isset($_GET['logout']))
- {
- session_destroy();
- header("Location:./");
- }
- include_once("conn.php");
- $username = mysql_real_escape_string(htmlspecialchars($_POST['username']));
- $password = md5($_POST['password']);
- $result = mysql_query("SELECT * FROM `users` WHERE username = '" . $username . "'");
- $row = mysql_fetch_array($result);
- if (mysql_num_rows($result) > 0)
- {
- if ($row['password'] == $password)
- {
- echo "1";
- $_SESSION['uname'] = $username;
- $_SESSION['lvl'] = $row['lvl'];
- }
- else echo "0";
- }
- else echo "0";
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement