• jQuery ajax pieprasījums

    GET
    $.ajax({
    type:'GET',
    url: 'http://www.kautkas.lv/kautkas.php',
    data: "action=something&id="+id,
    success:function(data){
    $('#lauks').html(data);
    }
    });

    POST
    $.ajax({
    type: "POST",
    url: "ajax.php?",
    data: { idnumurs: "id" },
    success:function(data){
    $("#lauks").val(data);
    }
    });


  • curl post pieprasījums

    curl_setopt($handle, CURLOPT_URL,"http://www.example.lv/kautkas.php");
    curl_setopt($handle, CURLOPT_POST, true);
    curl_setopt($handle, CURLOPT_POSTFIELDS, array("var1" => $var1 ));
    curl_exec($handle);