Guest User

Untitled

a guest
Feb 21st, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. $http({
  2. url:'http://xxx.xxx.xxx.xxx:8080/login',
  3. method:"POST",
  4. data:{user:$scope.user, password:$scope.password}
  5. })
  6.  
  7. $app->post('/login', function ($request, $response) {
  8. //Parametros que se pasan a la api
  9. $input = $request->getParsedBody();
  10. $req = $input['usuario'];
  11. $md5pass = md5($input['password']);
  12. $sth = $this->db->prepare("query");
  13. //bindParam pasandole los parametros para evitar injecciones sql
  14. $sth->bindParam("password", md5($input['password']));
  15. $sth->bindParam("usuario", $input['usuario']);
  16. $sth->execute();
  17. $todos = $sth->fetchAll();
  18. $cliente_id = $todos->cliente_id;
  19. ....
  20.  
  21. OPTIONS http://xxx.xxx.xxx.xxx:8080/login net::ERR_CONNECTION_REFUSED
Add Comment
Please, Sign In to add comment