Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("Connections/connection_filename.php");
- if(isset($_POST['submit']))
- {
- $username = mysql_real_escape_string($_POST['username']);
- $password = md5(mysql_real_escape_string($_POST['password']));
- $result = mysql_query("SELECT ID FROM users WHERE username = '$username' AND password = '$password' LIMIT 1");
- if(mysql_num_rows($result) == 1)
- {
- $row = mysql_fetch_assoc($result);
- $_SESSION['uid'] = $row['ID'];
- header("location: /home.php");
- }
- else
- {
- echo "Wrong username or Password";
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement