Advertisement
Guest User

Untitled

a guest
Apr 19th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['submit'])) {
  3.  
  4. $username = $_POST['username'];
  5. $password = md5($_POST['password']);
  6.  
  7. $logincheck = $stmt = $con->prepare("SELECT * FROM users WHERE username=:username and password=:password");
  8. $stmt->bindParam(':username', $username);
  9. $stmt->bindParam(':password', $password);
  10. $stmt->execute();
  11. $rows = $stmt->fetch(PDO::FETCH_NUM);
  12. if($rows > 0) {
  13. exit(header('Location: index.php'));
  14. }
  15. }
  16. ?>
  17.  
  18. <form method="post">
  19. <input type="text" name="username">
  20. <input type="password" name="password">
  21. <input type="submit" name="submit">
  22. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement