Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. <?php
  2. include("Connections/connection_filename.php");
  3.  
  4. if(isset($_POST['submit']))
  5. {
  6. $username = mysql_real_escape_string($_POST['username']);
  7. $password = md5(mysql_real_escape_string($_POST['password']));
  8.  
  9. $result = mysql_query("SELECT ID FROM users WHERE username = '$username' AND password = '$password' LIMIT 1");
  10.  
  11. if(mysql_num_rows($result) == 1)
  12. {
  13. $row = mysql_fetch_assoc($result);
  14.  
  15. $_SESSION['uid'] = $row['ID'];
  16.  
  17. header("location: /home.php");
  18. }
  19. else
  20. {
  21. echo "Wrong username or Password";
  22. }
  23. }
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement