Pass ajax response to php

0

I'm doing an ajax query from an external website. I receive the site data well but in json, I would like to send the response to php. This is the ajax code

var datos = {"Nombre:" : "Alejandro"};
var url = "http://quasar.e-htl.com.br/booking/hotels-availabilities";
    $.ajax({                        
       type: "POST",                 
       url: url,                    
       data: datos,
       dataType: "json",
       success: function(data)            
       {
        console.log(data);
         $('#resp').html(data);           
       }
     });

I receive the data from the url well and it shows it to me in the console.log, but I would like to send them to php

    
asked by Avancini1 25.05.2018 в 18:36
source

1 answer

-1

I leave you a code that can help you:

function send (value1, value2) {

    var parametros = { "variable1" : valor1,"variable2" : valor2 };

    $.ajax({
          data:  parametros,
          url:   'destino.php',
          type:  'post',        
          beforeSend: function() { $('#resultado'+valor1+'').html('<p>Procesando...</p>');},
          error: function() { $('#resultado'+valor1+'').html('<p>Error</p>'); },                 
          success:  function (response) { $('#resultado'+valor1+'').html(response); }
    }); }
    
answered by 26.05.2018 в 01:13