play login data in the API parameter

0

In the login I ask the user to put the email and cpf, there I have an api that plays data in a table that I created, then I need to get the parameters cpf and email to put in the api.

Ex:

http://8080/rest/apiCODCPF=02798477425&EMAIL=fulano%40fulano.com.br

How do I get the email and cpf data and play as a parameter in api?

I just have the api link, I have nothing else

Code to display api data:

    function load(){

  var xhr = new XMLHttpRequest();
  xhr.open("GET", "http://localhost/r/TRCKCLI?CODCPF=12345678901&EMAIL=fulano%40email.com");



  xhr.addEventListener("load", function() {
      var resposta = xhr.responseText;
      // console.log("ola1");
      var clientes = JSON.parse(resposta);
      // console.log("ola2");
      // console.log(clientes);

      for (var i =0; i < 1; i++){
          // console.log("ola3");
         var clientes_1 = clientes.TRACKER[i];
         AdicionaNome(clientes_1);
         AdicionaCPF(clientes_1);
         AdicionaProduto(clientes_1);
         AdicionaCidade(clientes_1);
         AdicionaCodigoProduto(clientes_1);
         AdicionaCodigoCliente(clientes_1);
         AdicionaStatus(clientes_1);
         ActiveStatusImage(clientes_1);
         ActiveOnlyPostagem(clientes_1);
         adicionaClienteNaTabelaViagem(clientes_1);
         ActiveQtdViagem(clientes_1);


     }

  });

  xhr.send();
      }
      window.onload = load;
    
asked by anonymous 14.12.2017 / 16:07

1 answer

1

If it is in this format use:

$email = $_GET['EMAIL'];
$cpf   = $_GET['apiCODCPF'];
    
14.12.2017 / 16:28