HTML code:
<formname= "Form1"Method= "POST"Action= "Manage.php?act=sub"> <inputtype= "checkbox"name= "mm[]"value= "<?= $row [' 0 ']?>"OnClick= "Checkall (this, ' mm ')"> <!--checkbox Implementation selects multiple records - <inputtype= "Submit"name= "Submit"value= "Delete"OnClick= "return (Confirm (' Confirm to delete? ')) "></form><inputtype= "checkbox"name= ' mm 'OnClick= "Checkitem (this, ' mm[] ')"></BR><inputtype= "checkbox"name= ' mm 'OnClick= "Checkitem (this, ' mm[] ')"></BR><inputtype= "checkbox"name= ' mm 'OnClick= "Checkitem (this, ' mm[] ')"></BR><inputtype= "checkbox"name= ' mm 'OnClick= "Checkitem (this, ' mm[] ')"><!--JS Implementation of all-select/Not-All-selected code -<Scriptlanguage=javascript>functionCheckall (E, itemname) {varAA=Document.getelementsbyname (ItemName); for (varI=0; I<aa.length; I++) aa[i].checked=e.checked;}functionCheckitem (E, allname) {var All=Document.getelementsbyname (allname) [0]; if(!e.checked) all.checked= false; Else { varAA=Document.getelementsbyname (e.name); for (varI=0; I<aa.length; I++) if(!aa[i].checked)return; All.checked= true; }}</Script>
PHP Code:
$num=$_post[' mm ']; // Here you get a post array; $str=implode$num// separates the values of the array; $query= "Delete from" ad ' WHERE ' id ' in ({$str//SQL syntax, in conditional statement
JS Implementation checkbox of the full selection and all-in-all function