Advertisement
Guest User

GetUsers.php

a guest
Nov 29th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2. include "connection.php";
  3.  
  4. $json = file_get_contents('php://input');
  5. $obj = json_decode($json,true);
  6.  
  7. $email = $obj['email'];
  8. $password = $obj['password'];
  9.  
  10. if($obj['email'] != ""){
  11. $result = $mysqli->query("SELECT* FROM users WHERE Username = '$email' AND Password = '$password'");
  12. if($result->num_rows == 0){
  13. echo json_encode("Wrong details");
  14. }else{
  15. echo json_encode("OK");
  16. }
  17.  
  18. }else{
  19. echo json_encode("Try again");
  20. }
  21.  
  22.  
  23.  
  24.  
  25. /*echo json_encode(array(
  26. 'message' => 'The message has been been returned from backend'
  27. ));*/
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement