Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $app->get('/api/login/{username}/{password}', function($request){
- $user = $request->getAttribute('username');
- $password = $request->getAttribute('username');
- require_once('db/connect.php');
- foreach($db->animais()
- ->where("username", $user)
- ->where("password", $password)
- as $row){
- $data = $row;
- $data["status"] = "sucesso";
- }
- if(isset($data)){
- echo json_encode($data, JSON_UNESCAPED_UNICODE);
- //echo json_encode($status, JSON_UNESCAPED_UNICODE);
- } else{
- $data["status"] = "erro";
- echo json_encode($data, JSON_UNESCAPED_UNICODE);
- }
- });
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement