Home > Backend Development > PHP Tutorial > Select and deselect all checkboxes and read the submitted content

Select and deselect all checkboxes and read the submitted content

WBOY
Release: 2016-07-29 09:13:35
Original
980 people have browsed it


   
       
   
     
   

 
       
           
           
            3
           

全选/全不选

 
             
       

   
 

demo1.php

header("content-type:text/html;charset=utf8");
if(empty($_POST['checkbox'])){
    echo "<script>alert('还没选择复选框');location.href='demo.php'</script>";
}
$checkbox = $_POST['checkbox'];
for($i=0;$i    
    if(!is_null($checkbox[$i])){
        
        $chechvalue=$checkbox[$i];
        echo $chechvalue."


";
    } 
}
?>

以上就介绍了复选框全选和反选并读取提交后的内容,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template