htmlCopy# html 5 <form action="index.php" method="post" > <input type="checkbox" name="test1" value="value1"> Option 1 <input type="checkbox" name="test2" value="value2"> Option 2 <input type="submit" value="Submit">  </form>     #php 7.x <?php if(isset($_POST['test1'])){     echo "checked value1"."<br>" } if(isset($_POST['test2'])){     echo "checked value2" } ?>

Read more of this post