I have this code:
$(".user").click(function(){
    var s = $(this).attr('data-s');
    var r = $(this).attr('data-r');
    $.ajax({
        type: 'post',
        url: 'd/gcm.php',
        data: {s: s, r: r},
        success: function(cmd){
            $("#cet").show();
            $("#smd").attr("data-t",s);
            $("#smd").attr("data-tt",r);
            setInterval(function(){
                 $('#mcd').load('d/gcm.php');
            }, 100);
        }
    });
});
So on click post is requested. Inside gcm.php I have:
$s = mysqli_real_escape_string($con, $_POST['s']);
$r = mysqli_real_escape_string($con, $_POST['r']);
if($s!="" && $s!=NULL && $r!="" && $r!=NULL){ DO SOMETHING }else echo "Empty";
Now When I do this it works:
success: function(cmd){ .... and change interval with : $('#mcd').html(cmd); } 
Also when I try to add code above to interval nothing happens, script do not work. So I am wondering why I get message "Empty"; When it is after post request and post success?
 
     
     
    