Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_POST) {
- // Clean the data
- $username = mysql_real_escape_string($_POST["username"]);
- $password = mysql_real_escape_string($_POST["password"]);
- // Get login information
- $query = "SELECT id, password FROM users WHERE username = '{$username}' LIMIT 1";
- $result = mysql_query($query);
- // Extract data from results
- $data = mysql_fetch_object($result);
- // If the provided password matches the password in our database, do login.
- if ($data->password == $password) do_login();
- }
- ?>
Add Comment
Please, Sign In to add comment