var arr1 = a.split("|");   
for(var i=0;i<kkk1.length;i++){
if(kkk1[i].checked==true){
xmlhttp.open("POST","../php/s18.php",true)
xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xmlhttp.onreadystatechange=chuli_18;
xmlhttp.send("aa="+aa);
}
}
checkbox为true的话 就把id传过来 然后删除checkbox对应的数据  如果是几个id 的话我怎么样发送才可以在php接到这些id  我现在3个只能拿到1个

解决方案 »

  1.   

    3个id可以直接php/s18.php?id1=1&id2=2&id3=3这样直接传值过去了也可以json数组传过去
      

  2.   

    var arr1 = a.split("|");
    var s = '';
    for(var i=0;i<kkk1.length;i++){
      if(kkk1[i].checked==true){
        s += '&aa[]='+aa;
      }
    }
    xmlhttp.open("POST","../php/s18.php",true)
    xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
    xmlhttp.onreadystatechange=chuli_18;
    xmlhttp.send(s.substr(1));