Advertisement
Guest User

config.php

a guest
Sep 7th, 2017
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?php
  2.  
  3. include 'config.php';
  4. if(isset($_POST['username']) && isset($_POST['password']))
  5. {
  6. $result='';
  7. $username = $_POST['username'];
  8. $password = $_POST['password'];
  9. $sql = 'SELECT * FROM tbl_login WHERE email = :username AND password = :password';
  10. $stmt = $conn->prepare($sql);
  11. $stmt->bindParam(':username', $username, PDO::PARAM_STR);
  12. $stmt->bindParam(':password', $password, PDO::PARAM_STR);
  13. $stmt->execute();
  14. if($stmt->rowCount())
  15. {
  16. $result="true";
  17. }
  18. elseif(!$stmt->rowCount())
  19. {
  20. $result="false";
  21. }
  22. echo $result;
  23. }
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement