Problem with ajax or a denver?



  • There's page .php, there's a .js in which there's an associated body for transfer to another page.php. The thing is, he's forming a line and he's supposed to go on different lines, but $_POST - empty, I don't understand.

    There's a code like this:

    $("form").submit(function () {
            switch(this.id) {
                case "table-form":
                    var $reserveName=$('#reserveName').val();
                    var $telephone=$('#telephone').val();
                    var $email=$('#email').val();
                    var $promo=$('#promo').val();
    
                var dataTable = {
                    reserveName:  $reserveName,
                    telephone: $telephone,
                    email: $email,
                    promo: $promo 
                };
                alert("OK");
                post("/baze.php",dataTable);
    
                return false;
                break;
    }
    

    }

    And here's the dealer.

    function post(url,data){
    var stringed = JSON.stringify(data);

    $.ajax({
        type: 'POST',
        url: url,
        data: {dataTab: stringed }
    });
    

    }

    And here's the php:

    print_r($_POST['dataTab']);
    $udxarr = json_decode(str_replace('\', '', $_POST['dataTab']));
    $udxarr2 = json_decode($_POST['dataTab']);

    If so:

     $.ajax({
    type: 'GET',
    url: '/baze.php',
    data: {dataTab: stringed }

          });
    

    They don't come to the field on baze.php the same page, I don't understand.



  • Well, I guess I don't understand any simple things, 'cause must be working, just somehow I don't get it. var_export($_POST)I've done it and it's working well, but I can't see it, it's empty, even. echo

    function post(url,data){
    
    jQuery.post(url, data)      
    

    };




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2