Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. <?php
  2. $app->get('/api/login/{username}/{password}', function($request){
  3.  
  4. $user = $request->getAttribute('username');
  5. $password = $request->getAttribute('username');
  6. require_once('db/connect.php');
  7.  
  8. foreach($db->animais()
  9. ->where("username", $user)
  10. ->where("password", $password)
  11. as $row){
  12. $data = $row;
  13. $data["status"] = "sucesso";
  14. }
  15.  
  16. if(isset($data)){
  17. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  18. //echo json_encode($status, JSON_UNESCAPED_UNICODE);
  19. } else{
  20. $data["status"] = "erro";
  21. echo json_encode($data, JSON_UNESCAPED_UNICODE);
  22. }
  23. });
  24. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement