Advertisement
Guest User

Untitled

a guest
Jul 11th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.74 KB | None | 0 0
  1. <?php
  2. $con = mysqli_connect("localhost", "u5222964_android", "ade20051996", "u5222964_android");
  3.  
  4. $username = $_POST['username'];
  5. $password = $_POST['password'];
  6.  
  7. $statement = mysqli_prepare($con, "SELECT * FROM user WHERE username = ? AND password = ?");
  8. mysqli_stmt_bind_param($statement, "ss", $username, $password);
  9. mysqli_stmt_execute($statement);
  10.  
  11. mysqli_stmt_store_result($statement);
  12. mysqli_stmt_bind_result($statement, $id, $username, $password ,$name, $email);
  13.  
  14. $response = array();
  15. $response["success"]= false;
  16.  
  17. while(mysqli_stmt_fetch($statement)){
  18.     $response["success"] = true;
  19.     $response["username"] = $username;
  20.     $response["name"] = $name;
  21.     $response["email"] = $email;
  22. }
  23. echo json_encode($response);
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement