I have to show a checked check box (like this one), but currently when extracting the value from the database (it shows this)
Is there a way to show the checked check box when extracting the known value from the database (PgAdmin)(All code is either HTML,CSS or PHP)
Topings: <br>
<br>
<label class="checkbox-container">
<input type="checkbox" name="toping" <?php if(isset($_POST['toping']) && $_POST['toping']=="Vanilla") echo "checked" ?> value="<?php echo $row['toping']; ?>">
<span class="checkmark"></span>
<span class="checkbox-txt"> Vanilla</span>
<br /></br>
</label>
<label class="checkbox-container">
<input type="checkbox" name="toping" <?php if(isset($_POST['toping']) && $_POST['toping']=="Chocolate") echo "checked" ?>value="<?php echo $row['toping']; ?>">
<span class="checkmark"></span>
<span class="checkbox-txt">Chocolate</span>
<br /></br>
</label>
<label class="checkbox-container">
<input type="checkbox" name="toping" <?php if(isset($_POST['toping']) && $_POST['toping']=="Caramel") echo "checked" ?>value="<?php echo $row['toping']; ?>">
<span class="checkmark"></span>
<span class="checkbox-txt">Caramel</span>
<br /></br>
</label>
<label class="checkbox-container">
<input type="checkbox" name="toping" <?php if(isset($_POST['toping']) && $_POST['toping']=="Strawberry") echo "checked" ?>value="<?php echo $row['toping']; ?>">
<span class="checkmark"></span>
<span class="checkbox-txt">Strawberry</span>
<br /></br>
</label>
<label class="checkbox-container">
<input type="checkbox" name="toping" <?php if(isset($_POST['toping']) && $_POST['toping']=="M&M's") echo "checked" ?>value="<?php echo $row['toping']; ?>">
<span class="checkmark"></span>
<span class="checkbox-txt">M&M's</span>
<br /></br>
</label>
<label class="checkbox-container">
<input type="checkbox" name="toping" <?php if(isset($_POST['toping']) && $_POST['toping']=="Oreo") echo "checked" ?>value="<?php echo $row['toping']; ?>">
<span class="checkmark"></span>
<span class="checkbox-txt">Oreo</span>
<br /></br>
</label>
<label class="checkbox-container">
<input type="checkbox" name="toping" <?php if(isset($_POST['toping']) && $_POST['toping']=="Meringue") echo "checked" ?>value="<?php echo $row['toping']; ?>">
<span class="checkmark "></span>
<span class="checkbox-txt">Meringue</span>
<br />
</label>


var_dump($_POST)? Have you confirmed that your $_POST variable contain the right value? Why do you have to echocheckedonvalueattribute?var_dump($_POST)the results I got were: ["toping"]=> string(182) “Vanilla This is the correct value, Hopefully this helps!phpand set$_POST['toping'] = 'Vanilla', it worked and it should, The Vanilla checkbox is checked. Try to add a space between?>andvalue, and let me know if that solves the problem.echo "checked" ?> value=instead ofecho "checked" ?>value. When I run your code, only Vanilla checkbox works, other than that it isn't, be careful.value="<?php echo $row['toping']; ?>. Another issue is when I load into the form the checkboxes its only after I press submit that it shows?