Guest User

Untitled

a guest
Jun 29th, 2018
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. <?php
  2.  
  3. include 'config.inc.php';
  4.  
  5. // Check whether username or password is set from android
  6. if(isset($_POST['username']) && isset($_POST['password']))
  7. {
  8. // Innitialize Variable
  9. $result='';
  10. $username = $_POST['username'];
  11. $password = $_POST['password'];
  12.  
  13. // Query database for row exist or not
  14. $sql = 'SELECT * FROM tbl_login WHERE email = :username AND password = :password';
  15. $stmt = $conn->prepare($sql);
  16. $stmt->bindParam(':username', $username, PDO::PARAM_STR);
  17. $stmt->bindParam(':password', $password, PDO::PARAM_STR);
  18. $stmt->execute();
  19. if($stmt->rowCount())
  20. {
  21. $result="true";
  22. }
  23. elseif(!$stmt->rowCount())
  24. {
  25. $result="false";
  26. }
  27.  
  28. // send result back to android
  29. echo $result;
  30. }
  31.  
  32. ?>
Add Comment
Please, Sign In to add comment