나는 그것을 할 방법은 아약스 전화를 배치하는 것입니다. 체크 박스에서 정보를 수집하는 자바 스크립트 함수를 만들 것입니다. 즉, 부재중인 학생의 ID를 수집 한 다음 처리하는 PHP 함수가있는 관리 페이지로 해당 ID를 보냅니다. 어떤 종류의 페이지를 사용하고 있는지 알지 못하지만, 가장 쉬운 방법을 묻고 있습니다. 그래서 어떻게 할 것입니까?
function getCheckBoxInfo()
{
///code here to iterate through checkboxes and
// find those that are checked/unchecked +
// their respective ids or names (e.g. value fields in html),
// google - looping through checkboxes
// then you place them in a number of variables
/// i would create maybe 10-15 variables, i dont think
/// more than that would be absent
//and then you send those variable to managePage.php
//using this ajax call
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("result").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","managePage.php?var1="+var1+"&var2="+var2,true);
xmlhttp.send();
}
그런 다음 managePage.php에서 변수 var1 = $ _GET [ "var1"]을 추출합니다.
또한 jquery ajax 호출을 살펴볼 수도 있습니다. 더 조밀합니다.
또한 Google - 자바 스크립트에서 아약스 호출을 통해 PHP 페이지로 데이터를 보낼 수도 있습니다.
이 기사를 확인하시는 것이 좋습니다. http://stackoverflow.com/help/how-to-ask. 아직 아무 것도 시도하지 않았습니까? – macoms01
당신은 HTTP 요청을 사용해야하지만 .. 더 좋은 질문을해야합니다 ... 당신은 페이지의 HTML을 게시 할 수 있습니까 ?? – Alist3r
그래서 교사가 결석 한 학생을 표시 할 수있는 한 페이지를 갖기를 원할 것입니다. – OneHoopyFrood