Advertisement
Guest User

Untitled

a guest
Jun 20th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. <?php
  2. include("connection.php");
  3.  
  4.  
  5. ?>
  6.  
  7. <?php
  8. /* Let's validate username and password */
  9.  
  10. $username = trim($_POST['username']);
  11. $password = md5($_POST['password']);
  12.  
  13. $select = "select username, password from quote where username = '$username'";
  14. $check = mysql_query($select);
  15. $checkitnow = mysql_fetch_array($check);
  16. $checkuser = $checkitnow['username'];
  17. $checkpass = $checkitnow['password'];
  18.  
  19. if ($checkuser == $username && $checkpass == $password) {
  20. $_SESSION['user_id'] = $checkitnow['id'];
  21.  
  22. header("Location: test.php");
  23. } else {
  24. echo "Authenticated Failed";
  25. }
  26.  
  27. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement